[iOS] Respect user numeric format overrides#130510
Draft
matouskozak wants to merge 1 commit into
Draft
Conversation
Use the current NSLocale for overrideable data on the Apple Hybrid user-default culture while keeping explicitly named cultures identifier-based. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates Apple Hybrid Globalization so the user-default culture can reflect iOS “Numeric Format” overrides (e.g., decimal/group separators) by switching relevant native locale lookups to use NSLocale.currentLocale when user overrides are enabled.
Changes:
- Plumbs a
useUserOverrideflag through Apple-hybrid native locale info entrypoints and corresponding managedLibraryImportdeclarations. - Creates a dedicated “user default”
CultureDatapath on Apple mobile Hybrid mode and uses it to constructCultureInfo.CurrentCulture. - Adds Apple mobile regression tests asserting current vs named culture number format behavior.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/native/libs/System.Globalization.Native/pal_localeStringData.h | Adds useUserOverride parameter to Apple-hybrid string locale info export. |
| src/native/libs/System.Globalization.Native/pal_localeNumberData.h | Adds useUserOverride parameter to Apple-hybrid numeric/grouping locale info exports. |
| src/native/libs/System.Globalization.Native/pal_locale.m | Introduces GetNativeLocale helper using currentLocale when overrides are requested; threads the flag through native exports. |
| src/libraries/Common/src/Interop/Interop.Locale.iOS.cs | Updates managed LibraryImport signatures to include useUserOverride (marshalled as UnmanagedType.Bool). |
| src/libraries/System.Private.CoreLib/src/System/Globalization/CultureInfo.Unix.cs | Uses a new Apple-hybrid user-default CultureData creation path for CurrentCulture. |
| src/libraries/System.Private.CoreLib/src/System/Globalization/CultureData.iOS.cs | Adds GetUserDefaultCultureData and threads useUserOverride to native locale info calls. |
| src/libraries/System.Private.CoreLib/src/System/Globalization/CultureData.cs | Ensures Apple-hybrid “user override” locale queries consult _bUseOverrides when calling into native. |
| src/libraries/System.Runtime/tests/System.Globalization.Tests/CultureInfo/CultureInfoCurrentCulture.cs | Adds Apple mobile tests for current vs named culture number separators. |
Contributor
|
Tagging subscribers to 'os-ios': @vitek-karas, @kotlarmilos, @steveisok, @akoeplinger |
This was referenced Jul 11, 2026
Open
Open
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.
Fixes #110430
Summary
Testing
Note
This pull request description was generated with GitHub Copilot.