Skip to content

chore(i18n): document and script the lang-file merge resolution - #240

Merged
jakub-przepiora merged 1 commit into
developfrom
chore/i18n-lang-conflict-skill
Aug 12, 2026
Merged

chore(i18n): document and script the lang-file merge resolution#240
jakub-przepiora merged 1 commit into
developfrom
chore/i18n-lang-conflict-skill

Conversation

@JanKolo04

Copy link
Copy Markdown
Collaborator

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

  • Bug fix
  • New feature
  • Refactor / cleanup
  • Documentation
  • Other:

Related issue

Closes #

Testing

  • Tested manually in browser
  • php artisan test passes
  • Tested as Operator / Supervisor / Admin role (if UI change)

Checklist

  • No .env secrets committed
  • Migration added if schema changed
  • $fillable updated if new model columns added
  • No raw SQL with user input (use Eloquent / Query Builder)
  • CSRF protection in place for any new forms
  • composer audit clean

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>
@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 49d2b4e9-e911-4ff7-ab4b-f2afd7f270ad

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@jakub-przepiora
jakub-przepiora merged commit 9f388b7 into develop Aug 12, 2026
2 checks passed
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