Skip to content

fix(sections-editor): translate the SEO form's "Use default" toggle label - #5267

Merged
pedrofrxncx merged 1 commit into
mainfrom
fix/general-seo-form-use-default-i18n-w2
Jul 27, 2026
Merged

fix(sections-editor): translate the SEO form's "Use default" toggle label#5267
pedrofrxncx merged 1 commit into
mainfrom
fix/general-seo-form-use-default-i18n-w2

Conversation

@pedrofrxncx

@pedrofrxncx pedrofrxncx commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Source: i18n hardening in the sections-editor SEO form (GeneralSeoForm), spotted while auditing the sections-editor area for polish per the repo's i18n rule ("never hardcode user-facing strings in apps/web/src").

Why: general-seo-form.tsx renders a per-field "Use default" switch label (lets a page-level SEO field inherit the site-level default) as a raw JSX string instead of going through useT(), so pt-br users see English text on an otherwise-translated form — same bug class as the existing i18n-hardening lane (#5048, #5062, #5099, #5110, #5141, #5214, #5218, #5170).

Change: added sectionsEditor.generalSeoForm.useDefault to both i18n/en/sections-editor.ts ("Use default") and i18n/pt-br/sections-editor.ts ("Usar padrão"), and swapped the hardcoded string in general-seo-form.tsx for t("sectionsEditor.generalSeoForm.useDefault"). No behavior change — pure string externalization.

Reviewer check: switch the app language to Português (Brasil) in preferences, open a page's SEO editor for a General page with a configured site-default SEO, and confirm the "Use default" toggle label now reads "Usar padrão".

Verified locally: bun run fmt (clean) and bunx tsc --noEmit in apps/web (clean, no new errors). Both en/pt-br dictionaries satisfy the satisfies Record<keyof typeof enDomain, string> check so a missing/extra key would have been a compile error. Full CI (lint, tests) will validate the rest.


Summary by cubic

Localizes the "Use default" toggle label in the sections editor SEO form by using useT() instead of a hardcoded string. Adds sectionsEditor.generalSeoForm.useDefault to i18n/en/sections-editor.ts and i18n/pt-br/sections-editor.ts so pt-br shows "Usar padrão".

Written for commit 3cd53d2. Summary will update on new commits.

Review in cubic

…abel

The per-field inherit-from-site-SEO toggle in GeneralSeoForm hardcoded
"Use default" in JSX instead of going through i18n, so pt-br users saw
English text there.
@pedrofrxncx
pedrofrxncx enabled auto-merge (squash) July 27, 2026 14:46
@pedrofrxncx
pedrofrxncx merged commit c0c3ac6 into main Jul 27, 2026
14 checks passed
@pedrofrxncx
pedrofrxncx deleted the fix/general-seo-form-use-default-i18n-w2 branch July 27, 2026 14:50
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