fix(sections-editor): translate rich-text toolbar aria-labels - #5533
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follows the repeated i18n hardening lane (#5099, #5321, #5348, #5369, #5373, #5377, #5433, #5446, #5465, #5477, #5479, #5487).
RichTextField's toolbar has 14ToolbarButtons that passlabelstraight through toaria-label. 4 of them (font-size inc/dec, style dropdown) already go throught(), 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.tsandpt-br/sections-editor.ts, and swapped each hardcodedlabel="..."fort("sectionsEditor.richTextField.<key>")inrich-text-field.tsx.To confirm:
grep -n 'label="' apps/web/src/components/sections-editor/fields/rich-text-field.tsxreturns nothing (all labels now go throught()), andcd apps/web && bunx tsc --noEmitpasses — the pt-br dictionary'ssatisfies 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 oxlinton 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.
t("sectionsEditor.richTextField.*").en/sections-editor.tsandpt-br/sections-editor.ts.Written for commit 5dc9ab9. Summary will update on new commits.