chore(i18n): document and script the lang-file merge resolution - #240
Merged
Conversation
backend/lang/{en,pl}.json conflict on almost every merge: new keys are appended,
so every branch that adds a string edits the same final line. Eight open
branches are currently doing that.
The instinctive fix — end every entry with a comma so the last line is not
special — is impossible: these are strict JSON files read by json_decode, and a
trailing comma makes the file unparseable, which would silently drop the whole
Polish UI back to English. So this documents the resolution instead, and
automates it.
.claude/skills/i18n-lang-files/ carries the rules and a resolver that merges
git's three stages per key rather than per line. That is what makes it correct
where a text-level union is not:
- a key deliberately deleted on one side is not resurrected by the other side
still having it (PR #239 removed two PAWS keys a naive union would restore),
- a key added on both sides appears once; duplicated, json_decode keeps only
the last and a translation vanishes with no error.
It checks en/pl parity and duplicate keys, and refuses to guess when both sides
changed the same translation's value differently. Verified by replaying the
PR #239 conflict: byte-identical to the hand-made resolution.
.claude/ stays ignored for personal assistant config; only .claude/skills/ is
tracked, since these are shared project workflows.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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
backend/lang/{en,pl}.json conflict on almost every merge: new keys are appended, so every branch that adds a string edits the same final line. Eight open branches are currently doing that.
The instinctive fix — end every entry with a comma so the last line is not special — is impossible: these are strict JSON files read by json_decode, and a trailing comma makes the file unparseable, which would silently drop the whole Polish UI back to English. So this documents the resolution instead, and automates it.
.claude/skills/i18n-lang-files/ carries the rules and a resolver that merges git's three stages per key rather than per line. That is what makes it correct where a text-level union is not:
It checks en/pl parity and duplicate keys, and refuses to guess when both sides changed the same translation's value differently. Verified by replaying the PR #239 conflict: byte-identical to the hand-made resolution.
.claude/ stays ignored for personal assistant config; only .claude/skills/ is tracked, since these are shared project workflows.
Type of change
Related issue
Closes #
Testing
php artisan testpassesChecklist
.envsecrets committed$fillableupdated if new model columns addedcomposer auditclean