Supplying localization
Localization can be supplied in both .resx and .l.yaml files. .l.yaml can be dropped in the Resources/ folder either as embedded resource or as output copied resource.
Note that it may be good idea to have "null" as Resources path in Startup.cs to have easier keys and consistent across service interfaces.
services.Configure<Microsoft.Extensions.Localization.LocalizationOptions>(options =>
{
options.ResourcesPath = null;
});
Example: Resources/samples.asp.Pages.IndexModel.l.yaml (Mark: Copy to Output Directory: Copy if newver)
TemplateFormat: BraceNumeric
PluralRules: Unicode.CLDR41
English:
- Culture: "en"
Items:
- Key: samples.asp.Pages.IndexModel.Home
Text: "Home page"
- Key: samples.asp.Pages.IndexModel.Welcome
Text: "Welcome"
- Key: samples.asp.Pages.IndexModel.Content
Text: Learn about <a href="http://avalanche.fi/Avalanche.Core/Avalanche.Localization/docs/aspnet/index.html">Avalanche.Localization</a>.
Example: Resources/fi/samples.asp.Pages.IndexModel.l.yaml
TemplateFormat: BraceNumeric
PluralRules: Unicode.CLDR41
Finnish:
- Culture: "fi"
Items:
- Key: samples.asp.Pages.IndexModel.Home
Text: "Kotisivu"
- Key: samples.asp.Pages.IndexModel.Welcome
Text: "Tervetuloa"
- Key: samples.asp.Pages.IndexModel.Content
Text: Lue lisää <a href="http://avalanche.fi/Avalanche.Core/Avalanche.Localization/docs/aspnet/index.html">Avalanche.Localization:sta</a>.