Skip to content

fix(sections-editor): translate rich-text toolbar aria-labels - #5533

Merged
pedrofrxncx merged 1 commit into
mainfrom
fix/rich-text-toolbar-i18n-w1
Aug 1, 2026
Merged

fix(sections-editor): translate rich-text toolbar aria-labels#5533
pedrofrxncx merged 1 commit into
mainfrom
fix/rich-text-toolbar-i18n-w1

Conversation

@pedrofrxncx

@pedrofrxncx pedrofrxncx commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Follows the repeated i18n hardening lane (#5099, #5321, #5348, #5369, #5373, #5377, #5433, #5446, #5465, #5477, #5479, #5487).

RichTextField's toolbar has 14 ToolbarButtons that pass label straight through to aria-label. 4 of them (font-size inc/dec, style dropdown) already go through t(), but the other 10 — bold, italic, underline, strikethrough, bullet list, ordered list, align left/center/right, justify — were hardcoded English strings. pt-br users get untranslated labels on the toolbar's most-used buttons (screen readers announce English regardless of locale).

Fix: added the 10 missing keys to en/sections-editor.ts and pt-br/sections-editor.ts, and swapped each hardcoded label="..." for t("sectionsEditor.richTextField.<key>") in rich-text-field.tsx.

To confirm: grep -n 'label="' apps/web/src/components/sections-editor/fields/rich-text-field.tsx returns nothing (all labels now go through t()), and cd apps/web && bunx tsc --noEmit passes — the pt-br dictionary's satisfies Record<keyof typeof enDomain, string> constraint would fail to compile if any key were missing.

Locally ran: bun run fmt (no changes), cd apps/web && bunx tsc --noEmit (clean), bunx oxlint on the 3 changed files (0 warnings/errors). Full CI validates the rest.


Summary by cubic

Localizes Rich Text toolbar aria-labels to fix untranslated buttons and improve screen reader output, especially for pt-br users.

  • Bug Fixes
    • Replaced hardcoded labels for bold, italic, underline, strikethrough, bullet/ordered list, and align left/center/right/justify with t("sectionsEditor.richTextField.*").
    • Added the corresponding keys to en/sections-editor.ts and pt-br/sections-editor.ts.

Written for commit 5dc9ab9. Summary will update on new commits.

Review in cubic

10 toolbar buttons (bold, italic, underline, strikethrough, bullet/ordered
list, align left/center/right/justify) used hardcoded English aria-label
strings while sibling buttons in the same toolbar (font size, style
dropdown) already went through t(). pt-br users get untranslated labels
on the toolbar's most-used buttons.
@pedrofrxncx
pedrofrxncx merged commit 0ab7f5c into main Aug 1, 2026
26 checks passed
@pedrofrxncx
pedrofrxncx deleted the fix/rich-text-toolbar-i18n-w1 branch August 1, 2026 01:59
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