Skip to content

fix(l10n): remove duplicate de/de_DE empty-state keys - #562

Merged
DeepDiver1975 merged 1 commit into
masterfrom
fix/l10n-de-duplicate-keys
Jul 27, 2026
Merged

fix(l10n): remove duplicate de/de_DE empty-state keys#562
DeepDiver1975 merged 1 commit into
masterfrom
fix/l10n-de-duplicate-keys

Conversation

@DeepDiver1975

Copy link
Copy Markdown
Member

Fixes duplicate translation keys introduced by the all-languages backfill (#561, now merged to master).

Problem

de and de_DE already carried No note selected and Create a note using the + button in the sidebar. from #552. The backfill appended both keys again with different wording, producing the same key twice in a single catalog object — a malformed JS object literal / JSON object resolved only by implicit last-wins. JSON parsers accept it, which is why validation didn't catch it.

Fix

Collapse each affected catalog to a single, register-correct entry (de = informal du, de_DE = formal Sie — intentionally distinct catalogs):

  • de — keeps the informal Erstelle eine Notiz über die +-Schaltfläche … (register-correct for the informal catalog; the duplicated feat(ui): show empty state when no note is selected #552 line was a formal Erstellen Sie string).
  • de_DE — keeps the formal Erstellen Sie eine Notiz über die +-Schaltfläche ….
  • The genuinely new Notes key added by the backfill is retained in both.

Only these 4 files change (de.{js,json}, de_DE.{js,json}); no other locale had a pre-existing No note selected/Create a note key, so none is affected.

Verification

  • No duplicate keys remain in any of the 4 files.
  • JSON re-validated for de.json / de_DE.json.
  • .js/.json message keys in sync per catalog.

🤖 Generated with Claude Code

The all-languages backfill appended "No note selected" and "Create a note
using the + button in the sidebar." to the de and de_DE catalogs, which
already carried those keys from #552. That produced the same key twice in a
single catalog object (malformed JS object literal / JSON), resolved only by
implicit last-wins.

Collapse each to a single register-correct entry: de keeps the informal
"Erstelle …" form, de_DE keeps the formal "Erstellen Sie …" form. The
genuinely new "Notes" key added by the backfill is retained.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
@DeepDiver1975
DeepDiver1975 requested a review from a team as a code owner July 27, 2026 10:21
@phil-davis

Copy link
Copy Markdown
Contributor

JSON parsers accept it, which is why validation didn't catch it

That's a bit sad, I thought that such things would be caught by validation somewhere.

@DeepDiver1975
DeepDiver1975 merged commit b43ba0c into master Jul 27, 2026
12 checks passed
@DeepDiver1975
DeepDiver1975 deleted the fix/l10n-de-duplicate-keys branch July 27, 2026 10:33
@phil-davis

Copy link
Copy Markdown
Contributor

That means a patch release, and update the version to go in the 11.0.0 release bundles.

DeepDiver1975 added a commit that referenced this pull request Jul 27, 2026
Since the version bump was authored, several user-facing PRs merged to
master that will ship inside 2.2.0. Record them in the release notes:
full translation backfill (#561), fenced-code-block background (#560),
zh-Hans/Mongolian corrections (#559), duplicate de/de_DE key removal
(#562), and the Transifex-sync retirement (#558).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
phil-davis pushed a commit that referenced this pull request Jul 27, 2026
* chore: bump version to 2.2.0

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>

* docs(changelog): cover l10n and CSS changes shipping in 2.2.0

Since the version bump was authored, several user-facing PRs merged to
master that will ship inside 2.2.0. Record them in the release notes:
full translation backfill (#561), fenced-code-block background (#560),
zh-Hans/Mongolian corrections (#559), duplicate de/de_DE key removal
(#562), and the Transifex-sync retirement (#558).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>

---------

Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
phil-davis pushed a commit that referenced this pull request Jul 27, 2026
Both JSON.parse and PHP's json_decode silently collapse duplicate object
keys (last value wins), so a catalog can carry the same key twice and still
parse as valid JSON. That is how the duplicate de/de_DE empty-state keys
reached master and needed the follow-up in #562.

Add tests/l10n/check-duplicate-keys.py, which parses every l10n/*.{js,json}
catalog with an object_pairs_hook that inspects all key/value pairs before
deduplication and fails on any repeated key (covering the nested translations
object of the .json format and the OC.L10N.register wrapper of the .js
format). Wire it up as a 'make test-l10n' target and a dedicated l10n-lint
GitHub Actions workflow so it runs on every push and pull request.

Verified the checker flags the exact duplicates from the pre-#562 tree.

Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
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