Skip to content

fix(editor): show the save status in the page's language - #813

Merged
dubadub merged 1 commit into
cooklang:mainfrom
LeMyst:fix/editor-save-status-i18n
Nov 3, 2026
Merged

dubadub merged 1 commit into
cooklang:mainfrom
LeMyst:fix/editor-save-status-i18n

Conversation

@LeMyst

@LeMyst LeMyst commented Oct 28, 2026

Copy link
Copy Markdown
Collaborator

Closes #812

The editor's save status and save pop-ups now follow the site's language.

  • edit.html gathers them in one saveText object filled from the locales, like renameMessages:
    • the statuses use the messages that already existed in every locale but were unused: editor-unsaved-changes (replacing "Modified"), editor-saving, editor-saved, editor-save-failed;
    • three new messages, in all nine locales: editor-not-saved-gone (the status after fix(editor): never write back a recipe renamed or deleted in another tab #809's refusal), editor-save-failed-detail ("Save failed: %s"), and editor-file-gone, the pop-up for a file renamed or deleted elsewhere. That one replaces the server's English error text.
  • The "Save failed" handed to the rename dialog when the pre-rename save fails is translated too.
  • console.error lines stay in English; they're for developers.

Other editor texts (pictures, delete, LSP status) are still English; this PR only covers the save status and its pop-ups.

Tests

  • editor-rename.spec.ts gets a French case: with cook_lang=fr-FR, the status reads "Enregistré" after a save. After the file is deleted elsewhere it reads "Non enregistré : renommé ou supprimé ailleurs", and the French explanation pops up. It fails against current main ("Saved").
  • tests/locales_test.rs passes: every locale has every message.
  • cargo test --workspace 1874 passed. Full chromium Playwright run green, apart from the specs that spawn target/debug/cook, which doesn't exist in my local setup. The pantry and shopping-list specs were rerun with --workers=1, as on CI.

The French, German, Spanish, Italian, Dutch, Swedish, Japanese and Basque texts were written to match the tone already used in each file; a native speaker's look is welcome.

🤖 Generated with Claude Code

https://claude.ai/code/session_01MmrM91dHzvQoaerCcR9wra

The editor's save status (Modified, Saving..., Saved, Save failed, and
since cooklang#809 "Not saved: renamed or deleted elsewhere") and its save
notices were written in English in the template, whatever the page's
language. Three of them already had messages in every locale, unused.

The status and the notices now come from the locales: the existing
`editor-unsaved-changes`, `editor-saving`, `editor-saved` and
`editor-save-failed`, and new `editor-not-saved-gone`,
`editor-save-failed-detail` and `editor-file-gone` in all nine. The
refusal of a file renamed or deleted elsewhere is explained in the
page's words instead of the server's English message.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MmrM91dHzvQoaerCcR9wra
@LeMyst
LeMyst marked this pull request as ready for review November 1, 2026 21:46
@dubadub
dubadub merged commit 7d65b22 into cooklang:main Nov 3, 2026
6 checks passed
LeMyst pushed a commit that referenced this pull request Nov 4, 2026
Add the three editor save-status messages from #813, which merged right
after the Greek locale and left the locale test failing. Re-encode the 8
pantry/shopping lines that were saved double-encoded, and apply the
wording suggestions from the #781 review.

Co-authored-by: Claude Opus 5.5 <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.

Editor save status and save errors are in English whatever the site's language

2 participants