@@ -91,18 +91,17 @@ This tool allows you to build a localization structure whose content can be chan
9191
9292### Installation
9393
94- 1 . Add NLocalizator NuGet package to your project
95-
96- ``` sh
97- dotnet add package NLocalizator
98- ```
94+ * Add NLocalizator NuGet package to your project
95+ ``` sh
96+ dotnet add package NLocalizator
97+ ```
9998
10099<!-- USAGE EXAMPLES -->
101100### Usage
102101
103102##### Create Language Files
104103
105- Create ` lang-name.json ` file in project directory. This file name is in use configuration of the tool.
104+ Create ` * lang-name* .json` file in project directory. This file name is in use configuration of the tool.
106105
107106For example ` tr.json ` file:
108107``` json
@@ -120,6 +119,8 @@ For example `tr.json` file:
120119##### Create The LocalizationBook
121120
122121``` csharp
122+ using NLocalizator ;
123+
123124public class DaysLocalizationBook : ILocalizationBook
124125{
125126 public string Monday { get ; set ; }
@@ -135,6 +136,8 @@ public class DaysLocalizationBook : ILocalizationBook
135136##### Dependency Injection
136137
137138``` csharp
139+ using NLocalizator ;
140+
138141builder .Services .AddLocalizator <DaysLocalizationBook >(options =>
139142 options .AddFolderPath (@" *the_folder_path_that_contains_tr.json_file*" )
140143 .AddLanguage (" tr" ));
@@ -143,6 +146,8 @@ builder.Services.AddLocalizator<DaysLocalizationBook>(options =>
143146##### Call the Localizator
144147
145148``` csharp
149+ using NLocalizator ;
150+
146151public class WeatherForecastController : ControllerBase
147152{
148153 private readonly Localizator <DaysLocalizationBook > _daysLocalizator ;
@@ -166,6 +171,33 @@ public class WeatherForecastController : ControllerBase
166171}
167172```
168173
174+ ##### Change The Language
175+
176+ * Make sure the new ` *lang-name*.json ` file be in the same folder with ` tr.json `
177+
178+ ` de.json ` file:
179+ ``` json
180+ {
181+ "Monday" : " Montag" ,
182+ "Tuesday" : " Deinstag" ,
183+ "Wednesday" : " Mittwoch" ,
184+ "Thursday" : " Donnerstag" ,
185+ "Friday" : " Freitag" ,
186+ "Saturday" : " Samstag" ,
187+ "Sunday" : " Sonntag"
188+ }
189+ ```
190+
191+ * Create a new post method in the controller
192+ ``` csharp
193+ [HttpPost (Name = " SetLanguageToGerman" )]
194+ public bool SetLanguageToGerman ()
195+ {
196+ _daysLocalizator .ChangeLanguage (" de" );
197+ return true ;
198+ }
199+ ```
200+
169201_ For more examples, please refer to the [ Sample Project] ( https://github.com/tolgacakir/NLocalizator/tree/main/samples/NLocalizator.Sample ) _
170202
171203<p align =" right " >(<a href =" #readme-top " >back to top</a >)</p >
0 commit comments