I am working on a Polish operating system:
In my class Statup.cs, I have the following code
var supportedCultures = new[]
{
new CultureInfo("en-GB")
};
app.UseRequestLocalization(
new RequestLocalizationOptions
{
DefaultRequestCulture = new RequestCulture("en-GB"),
SupportedCultures = supportedCultures,
SupportedUICultures = supportedCultures,
FallBackToParentCultures = true,
FallBackToParentUICultures = true,
RequestCultureProviders = null
});
The full parameters are for reference only so that nothing is installed. In mine _Layout.cshtml, I have the following code:
<div>Current Culture: @CultureInfo.CurrentCulture.DisplayName</div>
<div>Current UI Culture: @CultureInfo.CurrentUICulture.DisplayName</div>
The only supported and accessible culture should be en-GB, however, it is always displayed on the website:
Current Culture: Polski (Polska)
Current UI Culture: Polski (Polska)
I tried to add a package Microsoft.AspNet.Localization, but it does not matter. Based on the code in the localization middleware, everything should work as expected. I am running the latest version of ASP.NET Core 1.0.0.