Skip to content

.NET StringLocalizer with fixed culture

License

Notifications You must be signed in to change notification settings

EG-A-S/dotnet-string-localizer

Repository files navigation

.NET string localizer with culture

Implements IStringLocalizer that is bound to specific culture.

See dotnet/aspnetcore#7756 for context.

Installation

PM> Install-Package Rapal.StringLocalizerWithCulture

Usage

var services = new ServiceCollection()
    .AddLocalizationWithCulture(options => options.ResourcesPath = "Resources")
    .BuildServiceProvider();

var localizerFactory = services.GetRequiredService<IStringLocalizerWithCultureFactory>();
var localizer = localizerFactory.Create(typeof(MyClass), CultureInfo.GetCultureInfo("en-US"));
var translated = localizer["Hello"];

About

.NET StringLocalizer with fixed culture

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages