[Apple] Preserve Norwegian locale names in hybrid globalization#130854
Open
matouskozak wants to merge 6 commits into
Open
[Apple] Preserve Norwegian locale names in hybrid globalization#130854matouskozak wants to merge 6 commits into
matouskozak wants to merge 6 commits into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 237ad744-83ac-4aac-a090-3b2622841b67
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 237ad744-83ac-4aac-a090-3b2622841b67
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 237ad744-83ac-4aac-a090-3b2622841b67
|
Azure Pipelines: Successfully started running 3 pipeline(s). 12 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Tagging subscribers to this area: @dotnet/area-system-globalization |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts Apple hybrid globalization locale canonicalization so that requests for Norwegian (no / no-NO) preserve the requested culture name and ISO language codes (instead of being canonicalized to nb), and adds regression coverage in System.Globalization tests.
Changes:
- Add Apple-hybrid helpers to resolve locale language code / identifier while preserving
nowhen Foundation canonicalizes tonb. - Use the preserved language code for ISO639 2- and 3-letter language name queries and for parent-culture computation.
- Add a regression theory verifying
CultureInfo("no")andCultureInfo("no-NO")language-code/name/parent expectations.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/native/libs/System.Globalization.Native/pal_locale.m | Centralizes Apple-hybrid language-code / locale-identifier handling and uses it for locale name, ISO codes, and ParentName. |
| src/libraries/System.Runtime/tests/System.Globalization.Tests/CultureInfo/CultureInfoCtor.cs | Adds Norwegian regression assertions for culture name, ISO language codes, and parent culture. |
vitek-karas
reviewed
Jul 16, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 237ad744-83ac-4aac-a090-3b2622841b67
The strict Name/ISO/Parent assertions are only guaranteed on ICU (including Apple hybrid); exclude the NLS and invariant legs where no-NO may be unsupported. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 237ad744-83ac-4aac-a090-3b2622841b67
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 237ad744-83ac-4aac-a090-3b2622841b67
Member
Author
|
/azp run runtime-extra-platforms |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
|
Azure Pipelines: Successfully started running 3 pipeline(s). 12 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
noculture name and ISO language codes when Foundation canonicalizes it tonbno-NOparent fallback tonofor resource lookupFixes #112249
Testing
CultureInfoconstructor matrix: 348 passed, 0 failedGetCultureInfocanonicalization matrix: 22 passed, 0 failedNote
This PR description was generated with GitHub Copilot.