doxa-maps/library/components/legends
Doxa Maps f1ef566af9 The legend's export menu speaks the reader's language
Six user-facing strings in SemanticTreeLegend were hardcoded English, in the
one surface that generates a document translated into all eleven locales. A
reader in Arabic opened the export menu and met "Poster" and "Packet" beside a
packet whose every page is Arabic — two honest surfaces disagreeing.

  legend.export.poster       menu item
  legend.export.packet       menu item
  legend.exportButton        the trigger's visible label
  legend.exportSelection     the trigger's title AND aria-label
  legend.noDataAtThisLevel   the empty state
  aria.expandLegend          reused for the collapsed-legend reopen button,
                             which had a title and NO aria-label at all, so a
                             screen reader announced an unlabelled button

WHY A GATE NEVER CAUGHT THESE. Both menu items only exist after a click opens
the menu, so a check that renders a leaf and scans visible text cannot see
them. The trigger's accessible name is worse: it is never visible text at all.

KEY NAMES CARRY THE FALLBACK, so they are not free. This component has no
i18n on a bare host (useI18n() is guarded) and falls back to
humanizeKey(lastSegment). I first named the keys after their ROLE — .label,
.selection, .empty — and measured the result: the export button rendered
"Label". The last segment must BE the English word, which is why
legend.columns.name -> "Name" has always read correctly. Verified all six:
Poster / Packet / Export / Export Selection / No Data At This Level / Expand
legend. Never blank, never a raw key.

TRANSLATED, NOT COINED. check-i18n-never-translated warns against inventing
terminology because a wrong term looks authoritative to a reader who cannot
check it. That warning was written about "UUPGs", a term of art. These are
ordinary print-shop words with undisputed equivalents, and the test is whether
a bilingual reader would dispute the word: not for "poster", yes for an
unreached-people-group acronym. Leaving them English was the defect.
es/pt legitimately share "Exportar"; the gate fails only on all-eleven.

Verified: check:i18n-parity PASS (11 locales complete, 0 debt),
check:i18n-never-translated PASS (my six keys added nothing to the allowlist),
BUNDLE=my-upg-100-list vite build 318 modules clean, and a static sweep of the
template now finds zero hardcoded English in text nodes or in title/aria-label.
2026-09-26 04:38:59 +00:00
..
LegendDesktop.vue Search tier 2: a misspelled country resolves to THE country (best match, 2-edit cap) 2026-09-24 00:34:19 +00:00
LegendMobile.vue Phone: every shared control clears the 24px touch minimum 2026-09-25 07:30:14 +00:00
LegendProgressBar.vue Prayer legend: bar only in the header (no numbers); research map search pill matches the legend width; Mapbox attribution on every map 2026-09-16 20:16:04 -05:00
LegendRows.vue consolidate docs into documentation/ and deployment shells into deployment/ 2026-09-21 23:23:23 +00:00
LegendTools.vue Search bar off on MapLibre for country-posters, legend rises to fill it 2026-09-24 02:43:14 +00:00
SemanticTreeLegend.vue The legend's export menu speaks the reader's language 2026-09-26 04:38:59 +00:00