feat: add an xcode-xcstrings-v2 bucket that supports CLDR pluralization rules#1230
Merged
feat: add an xcode-xcstrings-v2 bucket that supports CLDR pluralization rules#1230
Conversation
Add opt-in xcode-xcstrings-v2 bucket type that converts CLDR plural forms to ICU MessageFormat for better translation quality and variable handling. ## Key Features - **ICU MessageFormat conversion**: Converts xcstrings plural forms to ICU format with metadata preservation - **Backward compatible**: Original xcode-xcstrings (v1) completely unchanged - **Opt-in migration**: Users explicitly choose v2 in their config - **Format preservation**: Maintains Objective-C format specifiers (%d, %.1f, %lld, %@) - **Variable handling**: Supports multiple variables with proper metadata - **CLDR support**: Handles all plural categories (zero, one, two, few, many, other) ## Implementation ### New Files - xcode-xcstrings-icu.ts - Core ICU conversion utilities (567 lines) - xcode-xcstrings-v2-loader.ts - V2 bucket loader (79 lines) - xcode-xcstrings-icu.spec.ts - 23 ICU conversion tests - xcode-xcstrings-lock-compatibility.spec.ts - 5 lock format tests - icu-safety.spec.ts - 22 safety tests for other bucket types ### Modified Files - loaders/index.ts - Register xcode-xcstrings-v2 bucket type - loaders/flat.ts - Add shouldPreserveObject option for ICU objects - loaders/variable/index.ts - ICU-aware metadata stripping - spec/formats.ts - Register xcode-xcstrings-v2 format ### Demo - demo/xcode-xcstrings-v2/ - Example files with ICU pluralization ## Lock File Format V1 (flattened): ``` item_count/one: <checksum> item_count/other: <checksum> ``` V2 (ICU object): ``` item_count: <checksum of ICU object> ``` ## Test Coverage - 72 total tests (50 new + 22 existing) - All 430 tests passing - Safety verified against 25+ bucket types 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
17prateek12
pushed a commit
to 17prateek12/lingo.dev
that referenced
this pull request
Jan 23, 2026
…on rules (lingodotdev#1230) * feat: add xcode-xcstrings-v2 bucket with ICU MessageFormat support Add opt-in xcode-xcstrings-v2 bucket type that converts CLDR plural forms to ICU MessageFormat for better translation quality and variable handling. ## Key Features - **ICU MessageFormat conversion**: Converts xcstrings plural forms to ICU format with metadata preservation - **Backward compatible**: Original xcode-xcstrings (v1) completely unchanged - **Opt-in migration**: Users explicitly choose v2 in their config - **Format preservation**: Maintains Objective-C format specifiers (%d, %.1f, %lld, %@) - **Variable handling**: Supports multiple variables with proper metadata - **CLDR support**: Handles all plural categories (zero, one, two, few, many, other) ## Implementation ### New Files - xcode-xcstrings-icu.ts - Core ICU conversion utilities (567 lines) - xcode-xcstrings-v2-loader.ts - V2 bucket loader (79 lines) - xcode-xcstrings-icu.spec.ts - 23 ICU conversion tests - xcode-xcstrings-lock-compatibility.spec.ts - 5 lock format tests - icu-safety.spec.ts - 22 safety tests for other bucket types ### Modified Files - loaders/index.ts - Register xcode-xcstrings-v2 bucket type - loaders/flat.ts - Add shouldPreserveObject option for ICU objects - loaders/variable/index.ts - ICU-aware metadata stripping - spec/formats.ts - Register xcode-xcstrings-v2 format ### Demo - demo/xcode-xcstrings-v2/ - Example files with ICU pluralization ## Lock File Format V1 (flattened): ``` item_count/one: <checksum> item_count/other: <checksum> ``` V2 (ICU object): ``` item_count: <checksum of ICU object> ``` ## Test Coverage - 72 total tests (50 new + 22 existing) - All 430 tests passing - Safety verified against 25+ bucket types 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * chore: fix formatting * chore: cleaning * chore: add changeset * chore: fix formatting --------- Co-authored-by: Claude <noreply@anthropic.com>
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.
Add xcode-xcstrings-v2 bucket type that preserves CLDR plural forms.