Localization: ResourceManagerWithCultureStringLocalizer class and WithCulture interface member removed
The ResourceManagerWithCultureStringLocalizer class and 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
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for