Skip to content

fix(i18n): MediaField hardcoded English (leaked on 3 admin screens) - #183

Merged
WebTigers merged 1 commit into
mainfrom
fix/mediafield-i18n
Aug 24, 2026
Merged

fix(i18n): MediaField hardcoded English (leaked on 3 admin screens)#183
WebTigers merged 1 commit into
mainfrom
fix/mediafield-i18n

Conversation

@WebTigers

Copy link
Copy Markdown
Owner

Tiger_View_Helper_MediaField rendered "Choose media" and "Clear" as hardcoded literals, so they stayed English in every locale. It now backs three admin screens (Site Identity, the CMS page editor, the new SEO screen), so the leak shows up three times.

  • Translated via a fail-soft _t(): the t view helper when a view is attached → the registry translator → the English literal. Fail-soft matters concretely — the helper is instantiated bare (no view, no translator) in ViewHelperTest, and a raw key rendered into a button would be worse than English.
  • Accessibility, while in here: the preview <img> had alt="" but it conveys which media is selected, so it now carries real alt text; the non-image tile gets a title + visually-hidden label with an aria-hidden icon.
  • 4 keys × 6 locales (147 → 151, parity held).

Suite: 2043 / 0 failures; --filter ViewHelper 7/7.

🤖 Generated with Claude Code

The shared media-picker helper rendered 'Choose media' and 'Clear' as literals, so they
stayed English in every locale. It's now on the Identity, CMS page-editor and SEO screens,
so the leak is visible three times over.

Routes through the 't' view helper when a view is attached (inheriting its source-locale
fallback), then the registry translator, then the English literal — fail-soft because the
helper is also instantiated bare, with no view and no translator, in ViewHelperTest.

Also gives the preview real alt text instead of alt="": it conveys WHICH media is
selected, so it isn't decorative. The non-image tile gets a title + visually-hidden label
and an aria-hidden icon.

4 keys x 6 locales (147 -> 151, parity held).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@WebTigers
WebTigers merged commit 91ede81 into main Aug 24, 2026
13 checks passed
@WebTigers
WebTigers deleted the fix/mediafield-i18n branch August 24, 2026 16:42
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