Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
The Microsoft.Extensions.Localization.ResourceManagerWithCultureStringLocalizer
class and Microsoft.Extensions.Localization.ResourceManagerStringLocalizer.WithCulture
method were removed in .NET 5.
For context, see aspnet/Announcements#346 and dotnet/aspnetcore#3324. For discussion on this change, see dotnet/aspnetcore#7756.
Version introduced
5.0
Old behavior
The ResourceManagerWithCultureStringLocalizer
class and the ResourceManagerStringLocalizer.WithCulture
method are obsolete in .NET Core 3.0 and later.
New behavior
The ResourceManagerWithCultureStringLocalizer
class and the ResourceManagerStringLocalizer.WithCulture
method have been removed in .NET 5. For an inventory of the changes made, see the pull request at dotnet/extensions#2562.
Reason for change
The ResourceManagerWithCultureStringLocalizer
class and ResourceManagerStringLocalizer.WithCulture
method were often sources of confusion for users of localization. The confusion was especially high when creating a custom IStringLocalizer implementation. This class and method give consumers the impression that an IStringLocalizer
instance is expected to be "per-language, per-resource". In reality, the instance should only be "per-resource". At run time, the CultureInfo.CurrentUICulture property determines the language to be used.
Recommended action
Stop using the ResourceManagerWithCultureStringLocalizer
class and the ResourceManagerStringLocalizer.WithCulture
method.
Affected APIs
Microsoft.Extensions.Localization.ResourceManagerWithCultureStringLocalizer
Microsoft.Extensions.Localization.ResourceManagerStringLocalizer.WithCulture