Skip to content

fix(i18n): translate the messages that only existed in English - #567

Merged
LeMyst merged 1 commit into
cooklang:mainfrom
LeMyst:fix/missing-translations
Sep 28, 2026
Merged

LeMyst merged 1 commit into
cooklang:mainfrom
LeMyst:fix/missing-translations

Conversation

@LeMyst

@LeMyst LeMyst commented Sep 28, 2026

Copy link
Copy Markdown
Collaborator

Closes #566.

Adds the messages that existed only in en-US, so these pages no longer fall back to English partway through:

Each translation uses the wording its locale already has: its word for the shopping list, "Retour" / "Zurück" / … like action-back, and in Italian "Utensili"/"Timer"/"Sezione" as on the recipe and pantry pages.

Keeping it that way

tests/locales_test.rs compares each locale with en-US, file by file, and fails with a list of locale/file: missing ids. Before this PR it fails on upstream main with exactly the gaps above.

A new locale, or a branch that adds strings, now has to translate them all. Leaving one in English on purpose means copying the English text, which at least puts the choice on the page.

Overlap with #563

#563 adds the same error-title / error-back-home translations, after its new role-forbidden line, because its 403 page is where the gap showed up. The two PRs touch the same few lines, so whichever merges second will need a rebase that keeps the lines once.

Checks

  • cargo test --test locales_test passes on this branch. With upstream main's locales/ restored, it fails and lists the de/es/eu/fr/nl error messages, the six shopping-include-in-list gaps and the 18 Italian toolbar messages.
  • cargo fmt --check and cargo clippy --all-targets are clean, with no warnings, and the full cargo test run has 0 failures.

🤖 Generated with Claude Code

- error-title and error-back-home in de-DE, es-ES, eu-ES, fr-FR and
  nl-NL, missing since dec59f1 added the error page.
- shopping-include-in-list in de-DE, es-ES, eu-ES, fr-FR, nl-NL and
  sv-SE, missing since cooklang#318.
- The 18 editor-toolbar-* messages cooklang#540 added to every locale but it-IT,
  which was merged (cooklang#543) while cooklang#540 was open.

Fluent falls back to en-US for a missing message, so nothing failed and
the pages came out half in English. tests/locales_test.rs now fails when
a locale lacks a message en-US has, naming the locale, file and ids.

Closes cooklang#566.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@LeMyst
LeMyst marked this pull request as ready for review September 28, 2026 18:05
@LeMyst
LeMyst merged commit 347e0e2 into cooklang:main Sep 28, 2026
6 checks passed
LeMyst added a commit that referenced this pull request Sep 28, 2026
#563 (2c82f28) and #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: myst <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
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.

Some messages are only in English: error page, include-in-list tooltip, Italian editor toolbar

1 participant