Skip to content

fix(sections-editor): translate the autosave failure toast - #6449

Merged
pedrofrxncx merged 1 commit into
mainfrom
fix/debounced-save-block-i18n-toast-w3
Aug 24, 2026
Merged

fix(sections-editor): translate the autosave failure toast#6449
pedrofrxncx merged 1 commit into
mainfrom
fix/debounced-save-block-i18n-toast-w3

Conversation

@pedrofrxncx

@pedrofrxncx pedrofrxncx commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

useDebouncedSaveBlock (used by every form-driven block editor — section forms, the SEO editor, SEO sheets) showed a hardcoded English "Save failed: {error}" toast on autosave failure, while every other save-failure toast in this same feature (see sections-editor.tsx, 9+ call sites) goes through t("sectionsEditor.sectionsEditor.saveFailed", { error }), which already has both an en and pt-br translation. A pt-br user editing a section form and hitting a save error would see this one toast in English while every other error toast in the same screen is localized.

Fix: route the same error through the existing useT() + sectionsEditor.sectionsEditor.saveFailed key instead of a template literal. No new translation keys needed — this key already exists and is already used for the identical message elsewhere in the same directory.

Checks run locally:

  • bun run fmt
  • cd apps/web && bunx tsc --noEmit — clean
  • bunx oxlint apps/web/src/components/sections-editor/use-save-block.ts — 0 warnings/errors

No existing test covers this hook's toast wiring (it's UI copy, not a trust boundary), so no test was added per the repo's no-coverage-PR rule. Full CI validates the rest.


Summary by cubic

Localizes the autosave failure toast in useDebouncedSaveBlock. Previously it showed a hardcoded English "Save failed: {error}"; now it uses t("sectionsEditor.sectionsEditor.saveFailed", { error }) so pt-br users see the translated message.

  • Affects all form-driven block editors using useDebouncedSaveBlock (section forms, SEO editor, SEO sheets).
  • Reuses existing i18n key; no new translation keys or copy changes.
  • No migration or config changes.

Written for commit 1f8e5e4. Summary will update on new commits.

Review in cubic

@pedrofrxncx
pedrofrxncx merged commit 1e89e26 into main Aug 24, 2026
34 checks passed
@pedrofrxncx
pedrofrxncx deleted the fix/debounced-save-block-i18n-toast-w3 branch August 24, 2026 15:49
decocms Bot pushed a commit that referenced this pull request Aug 24, 2026
PR: #6449 fix(sections-editor): translate the autosave failure toast
Bump type: patch

- decocms (apps/api/package.json): 4.260.6 -> 4.260.7
- @decocms/native (apps/native/package.json): 4.260.6 -> 4.260.7

Deploy-Scope: web
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.

1 participant