CurrentCulture on iOS not available at startup
See original GitHub issueDescription
On iOS at startup all culture info is null. ` var c = Thread.CurrentThread.CurrentUICulture;
var c1 = Thread.CurrentThread.CurrentCulture;
var c3 = CultureInfo.CurrentUICulture;
var c4 = CultureInfo.DefaultThreadCurrentUICulture;
var c5 = CultureInfo.DefaultThreadCurrentCulture;
var c6 = CultureInfo.InstalledUICulture;
var c7 = CultureInfo.InvariantCulture;
var c8 = CultureInfo.CreateSpecificCulture("en-GB");
` All of the above are null when called in MauiProgram
On android and windows targets getting the culture works as expected.
On iOS the culture info is only accessible after the first Page is displayed.
Steps to Reproduce
- Create new maui project.
- Add the code in description to the MauiProgram
- Run on iOS device.
Version with bug
Preview 11
Last version that worked well
Unknown/Other
Affected platforms
iOS
Affected platform versions
iOS 15
Did you find any workaround?
No response
Relevant log output
No response
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (4 by maintainers)
Top Results From Across the Web
ios - How to get correct value for CurrentCulture?
iOS application takes into account the settings chosen by the user, i.e. how do I get the correct value for Thread.CurrentCulture ?
Read more >Option to change language in System Settings on iOS?
I have a Xamarin Forms application, where on startup, I fetch the text content of ... a Dictionary<string, string> based on user's current...
Read more >Can't change CurrentCulture
We change the CurrentCulture in App.OnStartup as suggested in many answers on support tickets: protected override async void OnStartup(Start.
Read more >CultureInfo.CurrentCulture always returning Invariant ...
I've been trying to get the country of the ios/android device but It's getting quite messy. This should return the country code but...
Read more >A Guide to Using CultureInfo in .NET Applications
The CultureInfo class provides information about the locale of a .NET application. Get to know its core features and how to use it...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Bug repro with 17.2 Preview 1 on Iphone 13 iOS 15.2. Repro project link at 3962.zip
@jsuarezruiz so what additional info is required? On iOS resources always use the default culture resx and there’s no way to set any other culture or display resources from any other culture.