Skip to content

V10.0.8/fix mac os culture mapping#27

Merged
gimlichael merged 2 commits into
mainfrom
v10.0.8/fix-mac-os-culture-mapping
Jun 6, 2026
Merged

V10.0.8/fix mac os culture mapping#27
gimlichael merged 2 commits into
mainfrom
v10.0.8/fix-mac-os-culture-mapping

Conversation

@gimlichael

Copy link
Copy Markdown
Member

This pull request enhances support for additional ICU-only cultures, particularly those surfaced by macOS 26, by updating both the project file and the ICU-to-NLS mapping logic. It ensures that new surrogate culture files are included as embedded resources and that appropriate fallback mappings are defined for these cultures, improving compatibility and localization handling across platforms.

ICU surrogate file management:

  • Added over 100 new surrogate .bin files to the EmbeddedResource list in Codebelt.Extensions.Globalization.csproj to support ICU-only cultures, and removed them from the None list to ensure they are packaged with the assembly.

ICU-to-NLS mapping improvements:

  • Extended the ICU-to-NLS fallback mapping in WriteIcuNamedNlsAlternatives() to include:
    • Script/language aliases newly surfaced by macOS 26 ICU, such as ber-Latn-MAtzm-Latn-MA.
    • English and Spanish regional fallbacks for macOS 26 ICU-only cultures (e.g., en-ALen-001, es-003es-419).
    • Geographic/regional fallbacks for ICU-only cultures with no NLS equivalent, mapping to the closest available culture (e.g., ain-JPja-JP).

aicia-bot added 2 commits June 6, 2026 15:16
Add extended script/language aliases, regional fallbacks for English and Spanish, and geographic fallbacks for ICU-only cultures newly surfaced by macOS 26. Covers mappings like ber-Latn-MA, kk-Arab-CN, en-AL, es-003, ain-JP, and others with their respective NLS/ICU fallback targets.
Generate and include embedded resource binaries (.bin) for 148 ICU-only culture locales newly supported by macOS 26. Includes script/language variants, regional fallbacks for English and Spanish, and geographic locale surrogates. Updates project file to register all surrogate resources for compilation.
@gimlichael gimlichael self-assigned this Jun 6, 2026
Copilot AI review requested due to automatic review settings June 6, 2026 13:24
@gimlichael gimlichael removed the request for review from Copilot June 6, 2026 13:24
@greptile-apps

greptile-apps Bot commented Jun 6, 2026

Copy link
Copy Markdown

Greptile Summary

This PR extends localization support for ICU-only cultures surfaced by macOS 26, adding ~113 new surrogate .bin files as embedded resources and wiring up their ICU-to-NLS fallback mappings in the gse tooling program.

  • Program.cs: ~100 new dictionary entries added to WriteIcuNamedNlsAlternatives(), organized into script aliases (e.g. ber-Latn-MAtzm-Latn-MA), English/Spanish regional fallbacks (e.g. en-ALen-001, es-AGes-419), and geographic language fallbacks (e.g. ain-JPja-JP). The runtime file-copy logic and File.Exists guards are unchanged.
  • Codebelt.Extensions.Globalization.csproj: Each new .bin file is correctly removed from None and re-added as EmbeddedResource using the project's established MSBuild pattern.

Confidence Score: 5/5

This PR is safe to merge — it adds new culture mappings and embedded resources without modifying any existing logic.

The changes are purely additive: new dictionary entries appended to an existing map, new .bin files registered as embedded resources. The runtime loop and file-copy code paths are untouched. Every new ICU→NLS target (en-001, es-419, ja-JP, etc.) was already reachable via existing entries, so missing-file edge cases are already handled by the File.Exists guards in place. No existing behavior is altered.

No files require special attention.

Important Files Changed

Filename Overview
tooling/gse/Program.cs Extends WriteIcuNamedNlsAlternatives() with ~100 new ICU-to-NLS fallback entries covering macOS 26 script aliases, English/Spanish regional cultures, and minority-language geographic fallbacks; existing loop and file-copy logic is unchanged.
src/Codebelt.Extensions.Globalization/Codebelt.Extensions.Globalization.csproj Registers 113 new surrogate .bin files: removes each from the None item group and re-adds as EmbeddedResource, following the established MSBuild pattern for the project.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[gse Program.cs runs] --> B[WriteSurrogate for each NLS CultureInfo]
    B --> C[Writes .bin + .yml per culture]
    A --> D[WriteIcuNamedNlsAlternatives]
    D --> E{For each ICU→NLS mapping}
    E --> F[TryWriteNlsSurrogate ICU name]
    F -->|Windows NLS supports it| G[Write native surrogate for ICU name]
    F -->|ICU-only - not in NLS| H{NLS fallback .bin exists?}
    H -->|Yes| I[Copy fallback .bin to ICU name .bin]
    H -->|No| J[Skip silently]
    I --> K[ICU name surrogate ready]
    G --> K
    K --> L[Embedded in .csproj as EmbeddedResource]
Loading

Reviews (1): Last reviewed commit: "🍱 add locale surrogate resources for ma..." | Re-trigger Greptile

@codecov

codecov Bot commented Jun 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (d1acc14) to head (fc0c4b1).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #27   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            4         4           
  Lines          184       184           
  Branches         4         4           
=========================================
  Hits           184       184           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gimlichael gimlichael merged commit 7ca94b9 into main Jun 6, 2026
25 checks passed
@gimlichael gimlichael deleted the v10.0.8/fix-mac-os-culture-mapping branch June 6, 2026 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants