From 6bdfa59437f930a1c4f93b6ef697b23d2447a071 Mon Sep 17 00:00:00 2001 From: Doxa Maps Date: Sat, 26 Sep 2026 13:24:07 +0000 Subject: [PATCH] PPLR legend: its loading, empty and overflow lines speak the reader's language MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PPLR's SemanticTreeLegend (a diverged copy of the library's; retiring it is card RETIRE-PPLR-SEMANTICTREELEGEND) still typed in five strings: "Loading {label}…", "Loading data…", "No data at this level", "Showing top {n} of {m}" and "use the geocoder above to find the rest". The keys exist in all 11 locales since d4359163 (legend.loadingRows / loadingData / noDataAtThisLevel / showingTop / useGeocoderHint), which the library copy uses. They now go through the component's existing guarded translator (ta), with the English added to its fallback table, so a host without i18n still reads English, never a key. Numbers keep their current toLocaleString (numerals held). Headless: build OK, and check:no-free-identifiers, i18n-parity and profiles-mount pass. (check:ui-strings-have-keys, which found this, is not on main yet.) --- .../src/components/SemanticTreeLegend.vue | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/plugin-designs/pplr-data-maps/src/components/SemanticTreeLegend.vue b/plugin-designs/pplr-data-maps/src/components/SemanticTreeLegend.vue index 861a47dd2..db1eae8ca 100644 --- a/plugin-designs/pplr-data-maps/src/components/SemanticTreeLegend.vue +++ b/plugin-designs/pplr-data-maps/src/components/SemanticTreeLegend.vue @@ -30,6 +30,10 @@ const A11Y_EN = { 'legend.a11y.expandRow': 'Expand {label}', 'legend.a11y.collapseRow': 'Collapse {label}', 'legend.a11y.clearSelection': 'Clear selection', 'aria.expandLegend': 'Expand legend', 'aria.collapseLegend': 'Collapse legend', + // The legend's own states and hints (keys shared with library/components/legends/SemanticTreeLegend.vue). + 'legend.loadingRows': 'Loading {label}…', 'legend.loadingData': 'Loading data…', + 'legend.noDataAtThisLevel': 'No data at this level', 'legend.showingTop': 'Showing top {n} of {m}', + 'legend.useGeocoderHint': 'use the geocoder above to find the rest', } const fillA11y = (str, p) => String(str).replace(/\{(\w+)\}/g, (m, k) => (p && k in p ? p[k] : m)) let ta = (key, p) => fillA11y(A11Y_EN[key] ?? key, p) @@ -487,14 +491,13 @@ function rowClasses(row) {
- Loading {{ tabList[activeTab]?.label || 'rows' }}… + {{ ta('legend.loadingRows', { label: tabList[activeTab]?.label || 'rows' }) }}
-
Loading data…
-
No data at this level
+
{{ ta('legend.loadingData') }}
+
{{ ta('legend.noDataAtThisLevel') }}
- Showing top {{ tabList[activeTab].topLimit.toLocaleString() }} of - {{ topNodesAll.length.toLocaleString() }} — - use the geocoder above to find the rest + {{ ta('legend.showingTop', { n: tabList[activeTab].topLimit.toLocaleString(), m: topNodesAll.length.toLocaleString() }) }} — + {{ ta('legend.useGeocoderHint') }}