How to add localization in C#
May 19, 2022
- right click / project name / add / add ASP.net folder / App_GlobalResources
2. right click on App_LocalResources / Add / New Add Item
3. importtant
click the resouce file and the file name DON’T Add any Dash
otherwise the auto-generated file ResourceXXX.Designer.cs will not work.
4. click property and set your own name and value.
5. add Resources and Globalization in your .cs
using System.Resources;
using System.Globalization;
6. use in .cshtml
@yourProjectName.App_LocalResources.ResourceKorea.indexTitle
Result: