Reading this section, it looks like the way to set the locale in Blazor for a user is:
Navigation.NavigateTo(
$"Culture/Set?culture={cultureEscaped}&redirectUri={uriEscaped}",
forceLoad: true);
Is that correct? That strikes me as a really convoluted solution.
And does setting this then set it for the session/circuit? For both the strings returned from IStringLocalizer and the date/number formatting?
Also, is it correct to assume that the culture for a session/circuit, if I don't navigate to this url, is the one set in the user's browser?
Here's the source codes of
RequestLocalizationMiddleware:here CultureInfo.CurrentCulture was setted :
The providers are in order ,and when you send http request the first time you reach your app,the other providers usually don't contain the culture ,so it always get value from AcceptHeader provider
If you don't send another http request,the culture won't change,for example,if you nevigate to another component with the culture set in your url,the culture won't change
Notice if you input the url in address bar,if you are in
ServerPrerenderedmode,the culture would change the first time the component was rendered,and it would change back the second time component was rendered.