You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/en/Adding-New-Localization-Angular.md
+5-12Lines changed: 5 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,9 +2,7 @@
2
2
3
3
## Introduction
4
4
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).
8
6
9
7
## Steps to Add a New Language
10
8
@@ -14,9 +12,7 @@ To support a new language in the backend, you need to register it in the `Defaul
14
12
15
13
#### Modify DefaultLanguagesCreator.cs
16
14
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.
20
16
21
17
**DefaultLanguagesCreator.cs**
22
18
```c#
@@ -49,10 +45,8 @@ In the code above:
49
45
50
46
#### Create the Localization XML File
51
47
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.
56
50
57
51
**YourProjectName-pl.xml**
58
52
```xml
@@ -72,8 +66,7 @@ To fully support the new language in the Angular UI, you need to update various
72
66
73
67
#### Configure Date Localization in ngx-bootstrap
74
68
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.
Copy file name to clipboardExpand all lines: docs/en/Adding-New-Localization-Mvc.md
+3-10Lines changed: 3 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,9 +2,7 @@
2
2
3
3
## Introduction
4
4
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).
8
6
9
7
## Steps to Add a New Language
10
8
@@ -14,9 +12,7 @@ To support a new language in the backend, you need to register it in the `Defaul
14
12
15
13
#### Modify DefaultLanguagesCreator.cs
16
14
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.
20
16
21
17
**DefaultLanguagesCreator.cs**
22
18
```c#
@@ -49,10 +45,7 @@ In the code above:
49
45
50
46
#### Create the Localization XML File
51
47
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.
Copy file name to clipboardExpand all lines: docs/en/Infrastructure-Angular-Localization.md
+5-6Lines changed: 5 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,16 +2,15 @@
2
2
3
3
ASP.NET Zero **User Interface** is completely localized. ASP.NET Zero uses **dynamic, database based, per-tenant** localization.
4
4
5
-
XML files are used as base translation for desired languages (defined in the [serverside](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).
6
6
7
7
<imgsrc="images/localization-files-core-1.png"alt="Localization XML files"class="img-thumbnail" />
8
8
9
9
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/).
10
10
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.
16
15
17
16
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.
Copy file name to clipboardExpand all lines: docs/en/Infrastructure-Core-Mvc-Localization.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,6 @@ PhoneBook will be your ProjectName. You can add more XML files by copying one XM
10
10
11
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 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.
12
12
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.
14
14
15
15
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