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
I have basically followeed jfversluis on Maui Blazor hybrid localization, which can be found here
However, I've encountered an issue when trying to preserve localization settings in Preferences. Specifically, once the culture is set when the app starts, it becomes impossible to change it later. The code causing this issue is as follows
var language = Preferences.Get("language", "en-US");
var culture = new CultureInfo(language);
Thread.CurrentThread.CurrentCulture = culture;
Thread.CurrentThread.CurrentUICulture = culture;
CultureInfo.DefaultThreadCurrentCulture = culture;
CultureInfo.DefaultThreadCurrentUICulture = culture;
By commenting out this code ni App.xaml.cs, we enable the culture change to function correctly. However, this leaves us without a mechanism to maintain the set culture across application restarts
In video this problem does not occur because navigation was not performed. When we actually would navigate to counter page and then back to home, language will be same as app has set in start in App.xaml.cs.
Steps to Reproduce
Clone the application from the repository, switch the language setting to 'pl-PL', navigate to a different page such as the 'Counter' page, and then return to the main page where the Localizer with resources is located.
Hi I'm an AI powered bot that finds similar issues based off the issue title.
Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!
Description
I have basically followeed jfversluis on Maui Blazor hybrid localization, which can be found here
However, I've encountered an issue when trying to preserve localization settings in Preferences. Specifically, once the culture is set when the app starts, it becomes impossible to change it later. The code causing this issue is as follows
By commenting out this code ni App.xaml.cs, we enable the culture change to function correctly. However, this leaves us without a mechanism to maintain the set culture across application restarts
In video this problem does not occur because navigation was not performed. When we actually would navigate to counter page and then back to home, language will be same as app has set in start in App.xaml.cs.
Steps to Reproduce
Clone the application from the repository, switch the language setting to 'pl-PL', navigate to a different page such as the 'Counter' page, and then return to the main page where the Localizer with resources is located.
Link to public reproduction project repository
https://github.com/bpsc-wkubis/maui-blazor-hybrid-localization-issue
Version with bug
8.0.40 SR5
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
No response
Did you find any workaround?
No response
Relevant log output
No response
The text was updated successfully, but these errors were encountered: