-
Notifications
You must be signed in to change notification settings - Fork 5k
[iOS][globalization] Incorrect region information when using English (US)
language and non-US region
#113614
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Tagging subscribers to 'os-ios': @vitek-karas, @kotlarmilos, @ivanpovazan, @steveisok, @akoeplinger |
Tagging subscribers to this area: @dotnet/area-system-globalization |
When the language is set to |
It is still unclear to me why we're seeing this difference behavior between |
Region should be different from preferred language, because they're simply different things. For Windows, the current region is the UserGeo from Win32 API: runtime/src/libraries/System.Private.CoreLib/src/System/Globalization/CultureData.Windows.cs Lines 157 to 183 in 1151925
However, for all Unix-like OS's, the current region is simply CurrentCulture: runtime/src/libraries/System.Private.CoreLib/src/System/Globalization/CultureData.Unix.cs Line 53 in a45130e
On iOS, the CurrentCulture is the Locale from Native API: runtime/src/libraries/System.Private.CoreLib/src/System/Globalization/CultureData.iOS.cs Lines 25 to 30 in a45130e
|
I think the runtime/src/libraries/System.Private.CoreLib/src/System/Globalization/CultureData.Icu.cs Lines 178 to 185 in 69c8a1d
I agree that it does seem a bit off to use |
@matouskozak No, I don't know any other reason besides trying to fix the issue that the PR targeted. Maybe we should split it into separate functions, one using the preferredLanguage and the other to use the currentLocale. |
I found a perhaps related problem. Given these macOS settings, I get In a similar setup on iOS (see screenshot below), I get
|
This is a new and different issue I haven't seen before (different behavior in debug and release builds). Could you please open an issue for it with a repro steps? About the workaround, yes, you could also |
Thanks - I filed a new issue here: #115302 |
There seems to be something off with how iOS determines the language-region combination in
preferredLanguages
. If you select Germany region, you can chooseEnglish (US)
: this will result in behavior where the region is incorrectly set to US even though iPhone region is still Germany.English (UK)
: this will result in correct behavior, i.e., German regional info and English as a language.We should always return regional information for Germany as the iPhone region is set that way.
The text was updated successfully, but these errors were encountered: