Fix minimal format decoding using key instead of value for defaultMessage#3
Open
yourlow wants to merge 6 commits into
Open
Fix minimal format decoding using key instead of value for defaultMessage#3yourlow wants to merge 6 commits into
yourlow wants to merge 6 commits into
Conversation
Lingui v3+ renamed the 'defaults' field to 'message' in catalog JSON output. This caused the sync to silently fall back to using the key name as the source text, which then overwrote correct translations on translation.io. The issue manifested as a "flip-flop" where: 1. Sync reads `parsed[key].defaults` → undefined (field doesn't exist) 2. Falls back to `key` (e.g., "camera.errorUnknown") 3. Sends key name as source text to translation.io 4. Translation.io records this as a source edit 5. Next sync sees the edit, warns, but pushes key names again 6. Translations alternate between real text and key names Fix: Check for `message` field first (lingui v3+), then `defaults` (lingui v2), then fall back to key name. This maintains backward compatibility with lingui v2 while adding support for lingui v3, v4, and v5. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Add lingui v5 compatibility by reading 'message' field
…sage 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <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.
Summary
defaultMessagewas incorrectly set to the key instead of the valueObject.keystoObject.entriesto properly access both the key (forid) and value (fordefaultMessage)Test plan
defaultMessagevalues🤖 Generated with Claude Code