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
bb4fb335c5
commit
ecea532124
2 changed files with 23 additions and 16 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 },
|
||||
})
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue