Ten facet labels froze in the boot language
GiCombos built its facets object inside provide() at setup, so T() ran once and the result was handed to the consumer as a literal. After a live switch to Arabic every facet name stayed in English — the labels were keyed, the keys resolved, and the reader still saw the wrong language, because what was wrong was WHEN they were read rather than whether they were translated. check:frozen-labels cannot see this: every call site passes a real key and every key exists in all eleven locales. The defect is a lifetime, not a string. The facets are a computed now, provided through a getter so a consumer reading .facets re-reads it rather than taking a snapshot. Demonstrated rather than asserted: with a locale ref driven en -> ar, the old shape keeps returning "Access" and the new one returns "الوصول". Audited all 179 t() call sites across the three plugins by enclosing scope, not by grep. This was the only frozen one; the six GiDrawer hits my first pass flagged are inside a computed 60 lines up, which is why a lookback window is the wrong tool for a lifetime question.
This commit is contained in:
parent
6baf6dba65
commit
4ea988a4c9
11 changed files with 34 additions and 27 deletions
|
|
@ -48,8 +48,12 @@ function labelFor(key, value) {
|
|||
return [].concat(value).map((v) => labelOne(key, v)).join(', ')
|
||||
}
|
||||
provide('selectionBus', bus)
|
||||
provide('dashboardConfig', {
|
||||
facets: {
|
||||
// ★ THE FACET LABELS ARE A COMPUTED, NOT A LITERAL. Evaluated once inside provide() they froze in
|
||||
// the boot language: T() runs at setup, the object is handed to the consumer, and a live switch to
|
||||
// Arabic left every facet name in English. check:frozen-labels cannot see this — the call sites ARE
|
||||
// keyed and the keys DO resolve; what is wrong is WHEN they were read. A computed re-evaluates when
|
||||
// the locale ref changes, so the same keys now follow the reader.
|
||||
const facets = computed(() => ({
|
||||
access_level: { label: T('gospelInternet.facet.access', 'Access in their own language') },
|
||||
access_detail: { label: T('gospelInternet.col.access', 'In own language') },
|
||||
band: { label: T('gospelInternet.facet.band', 'Country internet use') },
|
||||
|
|
@ -60,7 +64,10 @@ provide('dashboardConfig', {
|
|||
religion: { label: T('gospelInternet.facet.religion', 'Religion') },
|
||||
way_in: { label: T('gospelInternet.facet.wayIn', 'Way in when nothing is in their language') },
|
||||
messaging: { label: T('gospelInternet.facet.messaging', 'Top messaging app (country)') },
|
||||
},
|
||||
}))
|
||||
provide('dashboardConfig', {
|
||||
// A getter, so a consumer reading .facets re-reads the computed rather than a snapshot of it.
|
||||
get facets() { return facets.value },
|
||||
facetRail: FACET_RAIL,
|
||||
legend: { labelFor },
|
||||
})
|
||||
|
|
|
|||
|
|
@ -644,7 +644,7 @@
|
|||
"bundle": "gospel-internet",
|
||||
"scriptUrl": "./gospel-internet/gospel-internet.js",
|
||||
"output": "dx-maps/gospel-internet/gospel-internet.js",
|
||||
"integrity": "sha384-G7PIOaa+ZXklHbabRFPnvEy2o3WWDb3Ci3/0Apy8OOgK8yTKaMDtLeLa+hx7Io9l",
|
||||
"integrity": "sha384-3bFlV2dK6lV7cy3B6QPcjS6QtIE1lW1R56IliClxCfaIK1Em73yPkQuETVpfys89",
|
||||
"elements": [
|
||||
"gospel-internet-board"
|
||||
],
|
||||
|
|
@ -665,7 +665,7 @@
|
|||
"scriptUrl": "./gospel-internet/gospel-internet.js",
|
||||
"embed": {
|
||||
"iframe": "<iframe src=\"./gospel-internet/board/index.html?utm_source=YOUR_SOURCE\" width=\"100%\" height=\"600\" style=\"border:none;border-radius:12px;\" allowfullscreen></iframe>",
|
||||
"script": "<!-- Mapbox engine, fetched early. Keep it only with a real Mapbox token in \"tk\": without one (or with \"provider\":\"maplibre\") the map draws with MapLibre and this line must go -->\n<link rel=\"preload\" as=\"script\" href=\"https://api.mapbox.com/mapbox-gl-js/v3.24.0/mapbox-gl.js\" integrity=\"sha384-tO0clamXONKwbiz7O6xJpUeyJbTSPugC+xM9clvfFvKTH3i8SmCawHGdf5quMWmZ\" crossorigin=\"anonymous\">\n<script>window.MAP_APP_API_URL=\"https://pray.doxa.life\";</script>\n<script src=\"./gospel-internet/gospel-internet.js\" integrity=\"sha384-G7PIOaa+ZXklHbabRFPnvEy2o3WWDb3Ci3/0Apy8OOgK8yTKaMDtLeLa+hx7Io9l\" crossorigin=\"anonymous\"></script>\n<!-- provider: \"maplibre\" is the default; change it to \"mapbox\" and fill tk to use Mapbox. -->\n<gospel-internet-board profile-config='{\"profile\":\"board\",\"provider\":\"maplibre\",\"tk\":\"YOUR_MAPBOX_TOKEN\",\"utmSource\":\"YOUR_SOURCE\",\"assetsBase\":\"YOUR_TREE_URL/assets\"}'></gospel-internet-board>"
|
||||
"script": "<!-- Mapbox engine, fetched early. Keep it only with a real Mapbox token in \"tk\": without one (or with \"provider\":\"maplibre\") the map draws with MapLibre and this line must go -->\n<link rel=\"preload\" as=\"script\" href=\"https://api.mapbox.com/mapbox-gl-js/v3.24.0/mapbox-gl.js\" integrity=\"sha384-tO0clamXONKwbiz7O6xJpUeyJbTSPugC+xM9clvfFvKTH3i8SmCawHGdf5quMWmZ\" crossorigin=\"anonymous\">\n<script>window.MAP_APP_API_URL=\"https://pray.doxa.life\";</script>\n<script src=\"./gospel-internet/gospel-internet.js\" integrity=\"sha384-3bFlV2dK6lV7cy3B6QPcjS6QtIE1lW1R56IliClxCfaIK1Em73yPkQuETVpfys89\" crossorigin=\"anonymous\"></script>\n<!-- provider: \"maplibre\" is the default; change it to \"mapbox\" and fill tk to use Mapbox. -->\n<gospel-internet-board profile-config='{\"profile\":\"board\",\"provider\":\"maplibre\",\"tk\":\"YOUR_MAPBOX_TOKEN\",\"utmSource\":\"YOUR_SOURCE\",\"assetsBase\":\"YOUR_TREE_URL/assets\"}'></gospel-internet-board>"
|
||||
},
|
||||
"instances": [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@
|
|||
|
||||
<script>window.MAP_APP_API_URL = "https://pray.doxa.life";</script>
|
||||
<!-- Bundle IIFE — registers the <gospel-internet-board> custom element. -->
|
||||
<script src="../../gospel-internet.js" integrity="sha384-G7PIOaa+ZXklHbabRFPnvEy2o3WWDb3Ci3/0Apy8OOgK8yTKaMDtLeLa+hx7Io9l" crossorigin="anonymous"></script>
|
||||
<script src="../../gospel-internet.js" integrity="sha384-3bFlV2dK6lV7cy3B6QPcjS6QtIE1lW1R56IliClxCfaIK1Em73yPkQuETVpfys89" crossorigin="anonymous"></script>
|
||||
|
||||
<script>
|
||||
// Mapbox token resolution — the A3 ladder, in precedence order:
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@
|
|||
|
||||
<script>window.MAP_APP_API_URL = "https://pray.doxa.life";</script>
|
||||
<!-- Bundle IIFE — registers the <gospel-internet-board> custom element. -->
|
||||
<script src="../gospel-internet.js" integrity="sha384-G7PIOaa+ZXklHbabRFPnvEy2o3WWDb3Ci3/0Apy8OOgK8yTKaMDtLeLa+hx7Io9l" crossorigin="anonymous"></script>
|
||||
<script src="../gospel-internet.js" integrity="sha384-3bFlV2dK6lV7cy3B6QPcjS6QtIE1lW1R56IliClxCfaIK1Em73yPkQuETVpfys89" crossorigin="anonymous"></script>
|
||||
|
||||
<script>
|
||||
// Mapbox token resolution — the A3 ladder, in precedence order:
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@
|
|||
|
||||
<script>window.MAP_APP_API_URL = "https://pray.doxa.life";</script>
|
||||
<!-- Bundle IIFE — registers the <gospel-internet-board> custom element. -->
|
||||
<script src="../../gospel-internet.js" integrity="sha384-G7PIOaa+ZXklHbabRFPnvEy2o3WWDb3Ci3/0Apy8OOgK8yTKaMDtLeLa+hx7Io9l" crossorigin="anonymous"></script>
|
||||
<script src="../../gospel-internet.js" integrity="sha384-3bFlV2dK6lV7cy3B6QPcjS6QtIE1lW1R56IliClxCfaIK1Em73yPkQuETVpfys89" crossorigin="anonymous"></script>
|
||||
|
||||
<script>
|
||||
// Mapbox token resolution — the A3 ladder, in precedence order:
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@
|
|||
|
||||
<script>window.MAP_APP_API_URL = "https://pray.doxa.life";</script>
|
||||
<!-- Bundle IIFE — registers the <gospel-internet-board> custom element. -->
|
||||
<script src="../../gospel-internet.js" integrity="sha384-G7PIOaa+ZXklHbabRFPnvEy2o3WWDb3Ci3/0Apy8OOgK8yTKaMDtLeLa+hx7Io9l" crossorigin="anonymous"></script>
|
||||
<script src="../../gospel-internet.js" integrity="sha384-3bFlV2dK6lV7cy3B6QPcjS6QtIE1lW1R56IliClxCfaIK1Em73yPkQuETVpfys89" crossorigin="anonymous"></script>
|
||||
|
||||
<script>
|
||||
// Mapbox token resolution — the A3 ladder, in precedence order:
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@
|
|||
|
||||
<script>window.MAP_APP_API_URL = "https://pray.doxa.life";</script>
|
||||
<!-- Bundle IIFE — registers the <gospel-internet-board> custom element. -->
|
||||
<script src="../../gospel-internet.js" integrity="sha384-G7PIOaa+ZXklHbabRFPnvEy2o3WWDb3Ci3/0Apy8OOgK8yTKaMDtLeLa+hx7Io9l" crossorigin="anonymous"></script>
|
||||
<script src="../../gospel-internet.js" integrity="sha384-3bFlV2dK6lV7cy3B6QPcjS6QtIE1lW1R56IliClxCfaIK1Em73yPkQuETVpfys89" crossorigin="anonymous"></script>
|
||||
|
||||
<script>
|
||||
// Mapbox token resolution — the A3 ladder, in precedence order:
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@
|
|||
|
||||
<script>window.MAP_APP_API_URL = "https://pray.doxa.life";</script>
|
||||
<!-- Bundle IIFE — registers the <gospel-internet-board> custom element. -->
|
||||
<script src="../../gospel-internet.js" integrity="sha384-G7PIOaa+ZXklHbabRFPnvEy2o3WWDb3Ci3/0Apy8OOgK8yTKaMDtLeLa+hx7Io9l" crossorigin="anonymous"></script>
|
||||
<script src="../../gospel-internet.js" integrity="sha384-3bFlV2dK6lV7cy3B6QPcjS6QtIE1lW1R56IliClxCfaIK1Em73yPkQuETVpfys89" crossorigin="anonymous"></script>
|
||||
|
||||
<script>
|
||||
// Mapbox token resolution — the A3 ladder, in precedence order:
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@
|
|||
|
||||
<script>window.MAP_APP_API_URL = "https://pray.doxa.life";</script>
|
||||
<!-- Bundle IIFE — registers the <gospel-internet-board> custom element. -->
|
||||
<script src="../../gospel-internet.js" integrity="sha384-G7PIOaa+ZXklHbabRFPnvEy2o3WWDb3Ci3/0Apy8OOgK8yTKaMDtLeLa+hx7Io9l" crossorigin="anonymous"></script>
|
||||
<script src="../../gospel-internet.js" integrity="sha384-3bFlV2dK6lV7cy3B6QPcjS6QtIE1lW1R56IliClxCfaIK1Em73yPkQuETVpfys89" crossorigin="anonymous"></script>
|
||||
|
||||
<script>
|
||||
// Mapbox token resolution — the A3 ladder, in precedence order:
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -644,7 +644,7 @@
|
|||
"bundle": "gospel-internet",
|
||||
"scriptUrl": "./gospel-internet/gospel-internet.js",
|
||||
"output": "dx-maps/gospel-internet/gospel-internet.js",
|
||||
"integrity": "sha384-G7PIOaa+ZXklHbabRFPnvEy2o3WWDb3Ci3/0Apy8OOgK8yTKaMDtLeLa+hx7Io9l",
|
||||
"integrity": "sha384-3bFlV2dK6lV7cy3B6QPcjS6QtIE1lW1R56IliClxCfaIK1Em73yPkQuETVpfys89",
|
||||
"elements": [
|
||||
"gospel-internet-board"
|
||||
],
|
||||
|
|
@ -665,7 +665,7 @@
|
|||
"scriptUrl": "./gospel-internet/gospel-internet.js",
|
||||
"embed": {
|
||||
"iframe": "<iframe src=\"./gospel-internet/board/index.html?utm_source=YOUR_SOURCE\" width=\"100%\" height=\"600\" style=\"border:none;border-radius:12px;\" allowfullscreen></iframe>",
|
||||
"script": "<!-- Mapbox engine, fetched early. Keep it only with a real Mapbox token in \"tk\": without one (or with \"provider\":\"maplibre\") the map draws with MapLibre and this line must go -->\n<link rel=\"preload\" as=\"script\" href=\"https://api.mapbox.com/mapbox-gl-js/v3.24.0/mapbox-gl.js\" integrity=\"sha384-tO0clamXONKwbiz7O6xJpUeyJbTSPugC+xM9clvfFvKTH3i8SmCawHGdf5quMWmZ\" crossorigin=\"anonymous\">\n<script>window.MAP_APP_API_URL=\"https://pray.doxa.life\";</script>\n<script src=\"./gospel-internet/gospel-internet.js\" integrity=\"sha384-G7PIOaa+ZXklHbabRFPnvEy2o3WWDb3Ci3/0Apy8OOgK8yTKaMDtLeLa+hx7Io9l\" crossorigin=\"anonymous\"></script>\n<!-- provider: \"maplibre\" is the default; change it to \"mapbox\" and fill tk to use Mapbox. -->\n<gospel-internet-board profile-config='{\"profile\":\"board\",\"provider\":\"maplibre\",\"tk\":\"YOUR_MAPBOX_TOKEN\",\"utmSource\":\"YOUR_SOURCE\",\"assetsBase\":\"YOUR_TREE_URL/assets\"}'></gospel-internet-board>"
|
||||
"script": "<!-- Mapbox engine, fetched early. Keep it only with a real Mapbox token in \"tk\": without one (or with \"provider\":\"maplibre\") the map draws with MapLibre and this line must go -->\n<link rel=\"preload\" as=\"script\" href=\"https://api.mapbox.com/mapbox-gl-js/v3.24.0/mapbox-gl.js\" integrity=\"sha384-tO0clamXONKwbiz7O6xJpUeyJbTSPugC+xM9clvfFvKTH3i8SmCawHGdf5quMWmZ\" crossorigin=\"anonymous\">\n<script>window.MAP_APP_API_URL=\"https://pray.doxa.life\";</script>\n<script src=\"./gospel-internet/gospel-internet.js\" integrity=\"sha384-3bFlV2dK6lV7cy3B6QPcjS6QtIE1lW1R56IliClxCfaIK1Em73yPkQuETVpfys89\" crossorigin=\"anonymous\"></script>\n<!-- provider: \"maplibre\" is the default; change it to \"mapbox\" and fill tk to use Mapbox. -->\n<gospel-internet-board profile-config='{\"profile\":\"board\",\"provider\":\"maplibre\",\"tk\":\"YOUR_MAPBOX_TOKEN\",\"utmSource\":\"YOUR_SOURCE\",\"assetsBase\":\"YOUR_TREE_URL/assets\"}'></gospel-internet-board>"
|
||||
},
|
||||
"instances": [
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue