Skip to content

[Apple] Preserve Norwegian locale names in hybrid globalization#130854

Open
matouskozak wants to merge 6 commits into
mainfrom
matouskozak-fix-norwegian-locale-ios
Open

[Apple] Preserve Norwegian locale names in hybrid globalization#130854
matouskozak wants to merge 6 commits into
mainfrom
matouskozak-fix-norwegian-locale-ios

Conversation

@matouskozak

Copy link
Copy Markdown
Member

Summary

  • preserve the requested no culture name and ISO language codes when Foundation canonicalizes it to nb
  • preserve no-NO parent fallback to no for resource lookup
  • centralize Apple locale language-code resolution and add cross-platform Norwegian regression coverage

Fixes #112249

Testing

  • CoreCLR iOS Simulator native/runtime-pack build
  • Norwegian culture regression theory: 2 passed, 0 failed
  • CultureInfo constructor matrix: 348 passed, 0 failed
  • GetCultureInfo canonicalization matrix: 22 passed, 0 failed

Note

This PR description was generated with GitHub Copilot.

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

Copy link
Copy Markdown
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.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @dotnet/area-system-globalization
See info in area-owners.md if you want to be subscribed.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 no when Foundation canonicalizes to nb.
  • 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") and CultureInfo("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.

Comment thread src/native/libs/System.Globalization.Native/pal_locale.m
Comment thread src/native/libs/System.Globalization.Native/pal_locale.m
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
Copilot AI review requested due to automatic review settings July 16, 2026 14:53
@matouskozak matouskozak temporarily deployed to copilot-pat-pool July 16, 2026 14:53 — with GitHub Actions Inactive
@matouskozak matouskozak temporarily deployed to copilot-pat-pool July 16, 2026 14:54 — with GitHub Actions Inactive
@matouskozak matouskozak temporarily deployed to copilot-pat-pool July 16, 2026 14:56 — with GitHub Actions Inactive
@matouskozak matouskozak temporarily deployed to copilot-pat-pool July 16, 2026 14:56 — with GitHub Actions Inactive
@matouskozak matouskozak temporarily deployed to copilot-pat-pool July 16, 2026 14:57 — with GitHub Actions Inactive

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread src/native/libs/System.Globalization.Native/pal_locale.m
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 237ad744-83ac-4aac-a090-3b2622841b67
@matouskozak matouskozak marked this pull request as ready for review July 16, 2026 16:18
Copilot AI review requested due to automatic review settings July 16, 2026 16:18
@matouskozak matouskozak temporarily deployed to copilot-pat-pool July 16, 2026 16:18 — with GitHub Actions Inactive
@matouskozak

Copy link
Copy Markdown
Member Author

/azp run runtime-extra-platforms

@matouskozak matouskozak temporarily deployed to copilot-pat-pool July 16, 2026 16:18 — with GitHub Actions Inactive
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@azure-pipelines

Copy link
Copy Markdown
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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regression: Norwegian localization no longer works in iOS with .NET 9

3 participants