-
-
Notifications
You must be signed in to change notification settings - Fork 8
One Resource File
Ziya Mollamahmut edited this page May 2, 2020
·
8 revisions
All localized strings for views, data annotations, identity errors ...etc. will take place in one resource file.
- Create a new folder named "LocalizationResources" and create an empty class inside it and name it
LocSource.cs
public class LocSource
{
}
- Setup
ExpressLocalization
to use one resource file:
services.AddRazorPages()
.AddExpressLocalization<LocSource>(ops =>
{
/* Add options here */
});
Notice: the above code demonstrats only the differentiated part for localizing with one resource file, the rest of the code must be done as described in Setup for Razor Pages
- Create one resource file for each culture in the same folder with our dummy class
LocSource.cs
:- LocSource.tr.resx
- LocSource.ar.resx
4.0, 3.2, 3.1, 3.0, 2.0, 1.1, 1.0