Localization
First you will need to add the following line to your Program.cs, with the additional cultures you will be using:
app.UseJJMasterDataWeb(options =>
{
options.AdditionalCultures.Add(new CultureInfo("es-AR"));
});
You can also configure your localization using the Action<RequestLocalizationOptions>
overload:
app.UseJJMasterDataWeb(options =>
{
var supportedCultures = new List<CultureInfo>
{
new("pt-BR"),
new("en-US")
};
options.DefaultRequestCulture = new RequestCulture("pt-BR");
options.SupportedCultures = supportedCultures;
options.SupportedUICultures = supportedCultures;
options.RequestCultureProviders.Insert(0,new CookieRequestCultureProvider
{
CookieName = CookieRequestCultureProvider.DefaultCookieName,
Options = options,
});
});
Now we have 3 scenarios to accomplish this:
Resource File
Fork JJMasterData, add a resource file for your language like this one, and send us a pull request. Other people from your country will have the values already out of the box.
Database
Go to /en-us/DataDictionary/Localization
or click at the localization modal located at Data Dictionary and populate the strings with your culture values, but only your system will reflect these changes
![Localization Modal](../media/Localization.png)
Tip
By default we write the resources in a table, allowed the user create dictionaries dynamically by adding translated words and texts, you can set the table name with the LocalizationTableName property in the MasterDataCommonsOptions class.
Implement IStringLocalizer
See ASP.NET Core Docs for more information.