Skip to content

Commit 10d7171

Browse files
committed
Refactor localization documentation for clarity and conciseness
1 parent c59b00c commit 10d7171

4 files changed

Lines changed: 14 additions & 29 deletions

docs/en/Adding-New-Localization-Angular.md

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22

33
## Introduction
44

5-
This document provides step-by-step instructions for adding a new localization (language) in your ASP.NET Zero Angular application.
6-
Localization allows users to interact with the application in their preferred language, thereby improving usability and accessibility.
7-
For more details on localization in ASP.NET Boilerplate, refer to the official documentation: [ASP.NET Boilerplate Localization](https://aspnetboilerplate.com/Pages/Documents/Localization).
5+
This document provides step-by-step instructions for adding a new localization (language) in your ASP.NET Zero Angular application. Localization allows users to interact with the application in their preferred language, thereby improving usability and accessibility. For more details on localization in ASP.NET Boilerplate, refer to the official documentation: [ASP.NET Boilerplate Localization](https://aspnetboilerplate.com/Pages/Documents/Localization).
86

97
## Steps to Add a New Language
108

@@ -14,9 +12,7 @@ To support a new language in the backend, you need to register it in the `Defaul
1412

1513
#### Modify DefaultLanguagesCreator.cs
1614

17-
In this step, you need to add the new language to the list of initial languages registered in the system.
18-
This ensures that the application recognizes the new language and makes it available for selection.
19-
Modify the `GetInitialLanguages` method to include the new language code, display name, and flag icon.
15+
In this step, you need to add the new language to the list of initial languages registered in the system. This ensures that the application recognizes the new language and makes it available for selection. Modify the `GetInitialLanguages` method to include the new language code, display name, and flag icon.
2016

2117
**DefaultLanguagesCreator.cs**
2218
```c#
@@ -49,10 +45,8 @@ In the code above:
4945

5046
#### Create the Localization XML File
5147

52-
The localization XML file contains key-value pairs for translating text within the application.
53-
Each language has its own XML file where you define translations for UI elements, messages, and labels.
54-
This file ensures that the application can display content in the selected language.
55-
Create a new localization file in the **Localization** folder of the `YourProjectName.Core` project.
48+
The localization XML file contains key-value pairs for translating text within the application. Each language has its own XML file where you define translations for UI elements, messages, and labels.
49+
This file ensures that the application can display content in the selected language. Create a new localization file in the **Localization** folder of the `YourProjectName.Core` project.
5650

5751
**YourProjectName-pl.xml**
5852
```xml
@@ -72,8 +66,7 @@ To fully support the new language in the Angular UI, you need to update various
7266

7367
#### Configure Date Localization in ngx-bootstrap
7468

75-
To ensure that the ngx-bootstrap date picker supports the new language, update the `ngx-bootstrap-datepicker-config.service.ts` file.
76-
This configuration allows the date picker to display dates in the correct format for the selected language.
69+
To ensure that the ngx-bootstrap date picker supports the new language, update the `ngx-bootstrap-datepicker-config.service.ts` file. This configuration allows the date picker to display dates in the correct format for the selected language.
7770

7871
**Import the Locale**
7972

docs/en/Adding-New-Localization-Mvc.md

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22

33
## Introduction
44

5-
This document provides step-by-step instructions for adding a new localization (language) in your ASP.NET Zero MVC application.
6-
Localization allows users to interact with the application in their preferred language, thereby improving usability and accessibility.
7-
For more details on localization in ASP.NET Boilerplate, refer to the official documentation: [ASP.NET Boilerplate Localization](https://aspnetboilerplate.com/Pages/Documents/Localization).
5+
This document provides step-by-step instructions for adding a new localization (language) in your ASP.NET Zero MVC application. Localization allows users to interact with the application in their preferred language, thereby improving usability and accessibility. For more details on localization in ASP.NET Boilerplate, refer to the official documentation: [ASP.NET Boilerplate Localization](https://aspnetboilerplate.com/Pages/Documents/Localization).
86

97
## Steps to Add a New Language
108

@@ -14,9 +12,7 @@ To support a new language in the backend, you need to register it in the `Defaul
1412

1513
#### Modify DefaultLanguagesCreator.cs
1614

17-
In this step, you need to add the new language to the list of initial languages registered in the system.
18-
This ensures that the application recognizes the new language and makes it available for selection.
19-
Modify the `GetInitialLanguages` method to include the new language code, display name, and flag icon.
15+
In this step, you need to add the new language to the list of initial languages registered in the system. This ensures that the application recognizes the new language and makes it available for selection. Modify the `GetInitialLanguages` method to include the new language code, display name, and flag icon.
2016

2117
**DefaultLanguagesCreator.cs**
2218
```c#
@@ -49,10 +45,7 @@ In the code above:
4945

5046
#### Create the Localization XML File
5147

52-
The localization XML file contains key-value pairs for translating text within the application.
53-
Each language has its own XML file where you define translations for UI elements, messages, and labels.
54-
This file ensures that the application can display content in the selected language.
55-
Create a new localization file in the **Localization** folder of the `YourProjectName.Core` project.
48+
The localization XML file contains key-value pairs for translating text within the application. Each language has its own XML file where you define translations for UI elements, messages, and labels. This file ensures that the application can display content in the selected language. Create a new localization file in the **Localization** folder of the `YourProjectName.Core` project.
5649

5750
**YourProjectName-pl.xml**
5851
```xml

docs/en/Infrastructure-Angular-Localization.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,15 @@
22

33
ASP.NET Zero **User Interface** is completely localized. ASP.NET Zero uses **dynamic, database based, per-tenant** localization.
44

5-
XML files are used as base translation for desired languages (defined in the [server side](Infrastructure-Core-Mvc-Localization)):
5+
XML files are used as base translations for desired languages (defined in the server-side); for defining and adding new localization, refer to the [How to Add a New Language in an ASP.NET Zero Angular Application](Adding-New-Localization-Angular).
66

77
<img src="images/localization-files-core-1.png" alt="Localization XML files" class="img-thumbnail" />
88

99
PhoneBook will be your ProjectName. You can add more XML files by copying one XML file and translate to desired language. See [valid culture codes](http://www.csharp-examples.net/culture-names/).
1010

11-
When you are adding a new localizable text, add it to the XML file of
12-
the default language then use in your application (Also, add translated
13-
values to corresponding XML files). No need to add it to database
14-
migration code since value in the XML file will be used as default. See
15-
[server side](Infrastructure-Core-Mvc-Localization) documentation for more.
11+
When you are adding a new localizable text, add it to the XML file of the default language then use in your application (Also, add translated
12+
values to corresponding XML files).
13+
14+
**Application languages** are defined in the **DefaultLanguagesCreator** class. This is used as seed data in the Entity Framework Migration. So, if you want to **add a new default language**, just add it into the **DefaultLanguagesCreator** class. This operation ensures that the new language is automatically seeded into the database during migration, making it available to the application at startup. This process occurs on the server side. You can refer to the documentation on [How to Add a New Language in an ASP.NET Zero Angular Application](Adding-New-Localization-Angular) for further guidance.
1615

1716
See [localization](https://aspnetboilerplate.com/Pages/Documents/Localization) and [language management](https://aspnetboilerplate.com/Pages/Documents/Zero/Language-Management) documentations for more information on localization.

docs/en/Infrastructure-Core-Mvc-Localization.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ PhoneBook will be your ProjectName. You can add more XML files by copying one XM
1010

1111
When you are adding a new localizable text, add it to the XML file of the default language then use in your application (Also, add translated values to corresponding XML files). No need to add it to database migration code since value in the XML file will be used as default.
1212

13-
**Application languages** are defined in **DefaultLanguagesCreator** class. This is used as a **seed data** in Entity Framework Migration. So, if you want to **add a new default language**, just add it into DefaultLanguagesCreator class. Also, you should add a corresponding XML file as described above as default translation.
13+
**Application languages** are defined in **DefaultLanguagesCreator** class. This is used as a **seed data** in Entity Framework Migration. So, if you want to **add a new default language**, just add it into **DefaultLanguagesCreator** class. Also, you should add a corresponding XML file as described above as default translation. You can refer to the documentation on [How to Add a New Language in an ASP.NET Zero MVC Application](Adding-New-Localization-Mvc) for further guidance.
1414

1515
See [localization](https://aspnetboilerplate.com/Pages/Documents/Localization) and [language management](https://aspnetboilerplate.com/Pages/Documents/Zero/Language-Management) documentations for more information.

0 commit comments

Comments
 (0)