Skip to content

fix(i18n): drop the error page strings defined twice - #579

Merged
LeMyst merged 1 commit into
cooklang:mainfrom
LeMyst:fix/duplicate-ftl-keys
Sep 28, 2026
Merged

LeMyst merged 1 commit into
cooklang:mainfrom
LeMyst:fix/duplicate-ftl-keys

Conversation

@LeMyst

@LeMyst LeMyst commented Sep 28, 2026

Copy link
Copy Markdown
Collaborator

Closes #578.

main is broken: every page the server renders panics, and the Test workflow fails. This PR is independent of the CI stack (#569…#577) and based directly on main, so it can merge first.

What changes

Testing

  • The new test catches the bug. Against the files as they are on main, it fails with:
    messages defined more than once (Fluent rejects the locale, and every page panics):
    de-DE: error-back-home (common.ftl, common.ftl)
    de-DE: error-title (common.ftl, common.ftl)
    es-ES: …  eu-ES: …  fr-FR: …  nl-NL: … (10 lines)
    
  • On this branch, all checks pass: cargo fmt --check, cargo clippy --workspace --all-targets --all-features -- -D warnings, and cargo test --workspace (every suite, 0 failures). That includes the servings_tests and tr_tests that fail on main.
  • A scan of all locales finds no other message defined twice.

Preventing a repeat

Both PRs were green on their own, and the break only appeared once both were on main. Branch protection's "Require branches to be up to date before merging", or a merge queue, would have run CI on the combination first.

🤖 Generated with Claude Code

cooklang#563 (2c82f28) and cooklang#567 (347e0e2) each added `error-title` and
`error-back-home`, under the same `# Errors` block, to the common.ftl
of de-DE, es-ES, eu-ES, fr-FR and nl-NL, and merged seconds apart.
Fluent refuses a bundle that defines a message twice, so since 347e0e2
every page the server renders panics ("Overriding { kind: Message, id:
"error-title" }") and the tests using translations fail with it. The
two copies are identical; keep the first.

tests/locales_test.rs gains a check that no locale defines a message
twice, across all its files, and names each one — rather than leaving
dozens of unrelated tests to panic on a poisoned loader.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@LeMyst
LeMyst marked this pull request as ready for review September 28, 2026 20:11
@LeMyst
LeMyst merged commit 9e0fd06 into cooklang:main Sep 28, 2026
6 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.

main: every page panics — error-title/error-back-home defined twice in 5 locales

1 participant