Skip to content

fix(i18n): accessible names stay English on every localized page #71

Closed as not planned

Description

@sydevs-bot

Summary

On /fr/… or /es-MX/…, everything a sighted visitor reads comes from the CMS and is translated. Everything only a screen reader consumes is a hardcoded English literal — 36 aria-label call sites and 5 screen-reader-only text nodes, 41 strings in all, in components that render on every locale.

#56 is the ticket that introduces the UI-string layer, and its scope enumerates visible copy only (nav labels, footer, page tags, meditation/lecture error copy). As written it will land and leave all 41 of these in English. This ticket is that gap, not a competing plan — fold it into #56 if you would rather have one.

Raised by the Wednesday analysis survey (ISO week 36, angle: accessibility).

Why it is worse than it sounds on the map page

pages/+lang.ts sets <html lang> from pageContext.locale, so a French page is correctly declared French — and a French screen reader then applies French phonetics to English words. On /fr/map, pages/map/_components/AtlasContent.tsx puts all of its structure in sr-only text: <h2>Meditation classes</h2> (line 115) and <dt>When</dt> / <dt>Where</dt> / <dt>Languages</dt> (168, 174, 180). Sighted visitors get that structure from the visual layout. For an AT user those five strings are the entire structure of the page, and they are all English.

Where they are

The 41 call sites, and the greps that produce them

20 string-literal aria-labels — grep -rn 'aria-label="' components layouts pages --include=*.tsx | grep -v stories | grep -v test, minus 5 matches that are JSDoc examples (Icon.tsx:59, Button.tsx:42,108,111, Tooltip.tsx:53):

MeditationPlayer.tsx:249,274 · ContentIndex.tsx:86 · ErrorFallback.tsx:73 · LocationSearch.tsx:240,246,268 · FormField.tsx:109 · Alert.tsx:94 · SocialShare.tsx:94,102 · AudioPlayer.tsx:158,177,187,212 · ContentCarousel.tsx:159,172 · EmbedButton.tsx:101 · Breadcrumbs.tsx:42 · AtlasContent.tsx:48

16 English strings inside aria-label={…} expressions — grep -rn 'aria-label={' … returns 24; 8 of those pass a caller-supplied prop through and are correct as they stand (ColumnCarousel.tsx:40, Icon.tsx:103, Button.tsx:308,325, Avatar.tsx:115, Spinner.tsx:108,122, LanguageFlag.tsx:67). The remaining 16 embed English:

SubtleSystem.tsx:300 ('Exit fullscreen'/'Enter fullscreen'), :326 (Learn more about ${…}) · MeditationPlayer.tsx:179,186,696 · RichText.tsx:248 · ContentCard.tsx:220 · SocialShare.tsx:110 · AudioPlayer.tsx:168,202 · HeroQuote.tsx:72 · TableOfContents.tsx:35 · ColumnCarousel.tsx:173 · MasonryGrid.tsx:84 · Image.tsx:347 · SocialIcon.tsx:96 (${label} (opens in new tab))

5 screen-reader-only text nodes — grep -rn 'className="sr-only"' …:

FormBuilder.tsx:438 (Submitting form, please wait…) · AtlasContent.tsx:115,168,174,180

Excluded as correct: Spinner.tsx:113,129, which render a {label} prop.

Approach

Blocked by: #56 — until the CMS translation layer exists there is no accessor to route these through, and adding a second local mechanism now would have to be unwound.

Acceptance criteria

  • All 41 strings above resolve through the CMS translation layer, with English as the fallback locale.
  • The accessor supports interpolated values, and the 16 expression call sites use it rather than composing English in JSX.
  • A test fails on a new string-literal aria-label or a new literal sr-only text node in components/** or pages/**.
  • /fr/map renders its sr-only heading and definition terms in French.

Verification checklist

  • grep -rn 'aria-label="' components layouts pages --include=*.tsx | grep -v stories | grep -v test returns only JSDoc example lines.
  • curl -s http://localhost:5173/fr/map | grep -o 'sr-only[^<]*<[^>]*>[^<]*' shows French, not When/Where/Languages.
  • pnpm lint && pnpm typecheck && pnpm test:run pass.
  • The new guard test fails when a literal aria-label="Dismiss" is reintroduced in components/molecules/Alert/Alert.tsx, and passes once reverted.

Notes

🤖 Written by the sydevs autonomous loop — see what this is

Activity

  1. added theissue type on Sep 2, 2026
  2. Ardnived commented on Sep 2, 2026

    @Ardnived
    Contributor

    @sydevs-bot Go ahead and fold this ticket into #56 , then close this ticket

  3. sydevs-bot commented on Sep 3, 2026

    @sydevs-bot
    ContributorAuthor

    Folded into #56 and closing, as asked. Nothing was dropped — the inventory, the greps, the guard test and the /fr/map argument all moved across.

    One thing was promoted rather than copied, because it changes #56's design and would have been easy to lose at the bottom of a scope list:

    Whatever t()-shaped helper #56 lands must take interpolated parameters — a flat key→string map would have to be reworked. 16 of the 41 sites compose English inside an expression (Learn more about {title}, Go to column {n}: {title}).

    That now sits in its own ⚠ subsection above #56's acceptance criteria, and the four criteria this ticket carried are appended to that list rather than living in a separate ticket that #56 could land without reading.

    What moved where
    From #71 Now in #56
    The 41-string inventory + the three greps <details> block under "Accessible names", with a note that the counts are a 2026-09-02 snapshot and should be re-run
    The /fr/map sr-only argument Body of "Accessible names" — the reason this is worse than a cosmetic gap
    Interpolation requirement Its own ⚠ subsection, called out as a decision to take before implementing the accessor
    4 acceptance criteria Appended to #56's list (interpolation, all 41 strings, the guard test, /fr/map in French)
    4 verification steps Appended to #56's verification checklist
    The a11y group in the wm-web-translations shape "Accessible names" §, one line
    Affected call sites #56's "Files affected"

    #56's own scope, criteria and BCP-47 work are unchanged — this is additive.

    The Blocked by: #56 line went with the ticket rather than into #56; there is no blocker left to record, since the work is now one ticket. #56 keeps its own dependency on sydevs/SahajCloud#528.

    🤖 Written by the sydevs autonomous loop — see what this is


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Fields

Priority

Medium

Hold Until

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions