You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a developer of a localizable web application, I would like my app to pick up the locale requested by the client, so that generated content can get localized accordingly.
Example
varlocalization= Localization.FromHeader()// default.FromQuery("lang")// FromCookie(), From...().FromRequest(r => ...).Set(culture:true, uiCulture:true).Supports(culture =>true)// allow to negoiate supported cultures and ignore non-supported ones.Default(CultureInfo.GetCultureInfo("hi-IN"));
Acceptance criteria
The functionality is implemented using a concern
The functionality is either implemented in the basics or in a new module (such as i18n)
The supported locales can be read from various places, such as query parameters or in a custom manner
The concern can be configured to set the .NET properties for the current culture
The concern can be configured to set a request property (so we do not need to rely on the .NET ones)
The concern allows the app to negoiate the locale to be used by filtering the requested ones
A default culture can be set (e.g. if none is passed by the client)
The functionality is covered by acceptance tests
The text was updated successfully, but these errors were encountered:
FYI when using docker to host the app and especially when using alpine linux, be aware that application is by default forced to run in globalization invariant mode, which causes any attempt to change the current culture in runtime to throw an expection. Furthermore the alpine base image does not contain ICU (International Components for Unicode) which is need for .net globalization to work.
Use different base image that contains ICU and does not disable globalization.
Force disable invariant globalization in .csproj file <InvariantGlobalization>false</InvariantGlobalization>.
Set following ENV variable in docker file ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false (for some reason setting only one of the ENV or csproj option did not worked for me, had to set both).
Install icu libs on top of alpine base image:
As a developer of a localizable web application, I would like my app to pick up the locale requested by the client, so that generated content can get localized accordingly.
Example
Acceptance criteria
i18n
)The text was updated successfully, but these errors were encountered: