[release/8.0][Apple] Use NSLocale.preferredLanguages on for default locale name#102748
Merged
matouskozak merged 1 commit intodotnet:release/8.0-stagingfrom Jun 21, 2024
Conversation
Contributor
|
Tagging subscribers to this area: @dotnet/area-system-globalization |
This was referenced May 28, 2024
Closed
Member
Author
|
/azp run runtime-extra-platforms |
|
Azure Pipelines successfully started running 1 pipeline(s). |
This was referenced May 28, 2024
Open
mkhamoyan
approved these changes
May 30, 2024
Contributor
|
Today is code complete for the July Release. Has this been approved by Tactics? |
Contributor
|
There's also many CI failures. Can you please check if they're related to this PR? |
Member
Author
|
/azp run runtime-extra-platforms |
|
Azure Pipelines successfully started running 1 pipeline(s). |
This was referenced Jun 14, 2024
Member
Author
The failures on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
In this PR, we change the
DetectDefaultAppleLocaleNameto use the ObjCpreferredLanguagesAPI to retrieve the device's primary language. This will make sure that users can retrieve the correct locale and use localized strings as expected.Note, this doesn't change the specific whitelisting done for mobile .NET 8 ICU https://github.com/dotnet/icu/blob/dotnet/main/icu-filters/icudt_mobile.json#L8-L194. Users will be able retrieve the underlining ICU data (e.g.
DateTimeFormat) only for the locales specifically included the ICU pack.Customer Impact
Customer reported incorrect locale returned when setting iPhone region to "China mainland" and language to "Chinese Traditional". Returned
zh-CNinstead ofzh-Hant-CN.Regression
Testing
Tested locally on iOS simulator by copying new
libSystem.Globalization.Native.dylibandlibmonosgen-2.0.dylibinto a local version of dotnet and building customer provided MAUI repro app. Verified that the MAUI repro works as expected with the fix included in this PR.Risk
Affects Globalization code on Apple mobile scenario.