fix(i18n): MediaField hardcoded English (leaked on 3 admin screens) - #183
Merged
Conversation
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>
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.
Tiger_View_Helper_MediaFieldrendered "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._t(): thetview 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) inViewHelperTest, and a raw key rendered into a button would be worse than English.<img>hadalt=""but it conveys which media is selected, so it now carries real alt text; the non-image tile gets atitle+visually-hiddenlabel with anaria-hiddenicon.Suite: 2043 / 0 failures;
--filter ViewHelper7/7.🤖 Generated with Claude Code