Skip to content

Fix/icu to nls mapping#20

Merged
gimlichael merged 10 commits intomainfrom
fix/icu-to-nls-mapping
Feb 21, 2026
Merged

Fix/icu to nls mapping#20
gimlichael merged 10 commits intomainfrom
fix/icu-to-nls-mapping

Conversation

@gimlichael
Copy link
Copy Markdown
Member

@gimlichael gimlichael commented Feb 21, 2026

This pull request introduces improvements to handling ICU-only culture names in the globalization extension project. The main focus is on ensuring that surrogate resources for these cultures are included and mapped correctly, both in the build process and in test coverage. Additionally, code formatting and organization have been improved in several files.

Resource handling and mapping enhancements:

  • Added removal and inclusion of surrogate resource files for ICU-only culture names in the project file, ensuring these cultures are properly embedded as resources. (Codebelt.Extensions.Globalization.csproj)
  • Implemented a new method, WriteIcuNamedNlsAlternatives, in Program.cs to map ICU-only culture names to their nearest NLS equivalents and copy surrogate files accordingly, so ICU-based environments can resolve them from the same embedded resource set. (tooling/gse/Program.cs)

Testing improvements:

  • Added a new test, UseNationalLanguageSupport_EnsureAllIcuCulturesAreMapped, to verify that all ICU culture names are mapped and covered by surrogate resources, improving test coverage for culture support. (CultureInfoExtensionsTest.cs)

Code organization and formatting:

  • Improved code formatting and organization in both test and tooling files, including splitting long parameter lists and updating using statements for clarity. (CultureInfoExtensionsTest.cs, Program.cs) [1] [2] [3]

Summary by CodeRabbit

  • Tests

    • Added a test that verifies all ICU cultures are mapped and supported, reporting any missing mappings.
  • Chores

    • Adjusted packaging to embed additional globalization resource files.
    • Enhanced tooling to generate and materialize ICU-to-NLS surrogate resources and fallback alternatives for wider locale coverage.
  • Bug Fixes

    • Added a defensive check to surface a clear error when an expected embedded globalization resource is missing.

Loading
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