The composed grid's locale depends on a spelling neither file mentions
Auditing Big Picture for goal (d) I read this as a live defect: big-picture threads the host's locale into
each child's profile-config as `lang`, while the grid's prop is `languageCode`. On a profile-config embed
that would leave a composed grid in the wrong language — exactly the failure 8b40f6c58 was written to fix.
It is not a defect. people-groups-grid.vue accepts three spellings — languageCode || locale || lang — and
`lang` is the third. Two greps settled it, and the near-miss is the point: nothing at either end said so.
Both ends now do. The writer records that the spelling is load-bearing and which fallback it lands on; the
reader records that `lang` has a caller and why that caller cannot reach it any other way — getRuntimeLocale
is module state, and a separately-built child bundle gets its own copy, so threading the config is the only
channel big-picture has.
★ WHY A COMMENT AND NOT A GATE. The failure is invisible in the obvious place: ?lang= embeds keep working,
because the grid falls through to localeFromUrl(). Only a host passing profile-config sees it, which is the
smaller and quieter half of the traffic. A gate for that would have to stand up a composed embed with a
profile-config locale and read rendered text — which is rega's browser run, not a headless check — so the
honest guard is to make the coupling legible to whoever next tidies either list.
No behaviour change. Verified: check:sfc-parse PASS.
This commit is contained in:
parent
4f3858eab8
commit
39b3285f55
2 changed files with 11 additions and 0 deletions
|
|
@ -126,6 +126,12 @@ watch(textDir, reflectDir)
|
|||
const listConfig = computed(() => {
|
||||
const cfg = {}
|
||||
if (config.value.list) cfg.list = config.value.list
|
||||
// ⚠ THE SPELLING IS LOAD-BEARING AND THE TWO SIDES DO NOT MATCH BY NAME. This writes `lang`; the
|
||||
// grid's prop is `languageCode`. It works because people-groups-grid.vue accepts three spellings —
|
||||
// languageCode || locale || lang — and `lang` is the THIRD of them. Rename or "tidy" either side
|
||||
// without the other and a composed grid silently renders in the wrong language on a profile-config
|
||||
// embed, which is the exact failure 8b40f6c58 was written to fix and which no gate would catch:
|
||||
// ?lang= embeds keep working, so only a host passing profile-config sees it.
|
||||
if (hostLang.value) cfg.lang = hostLang.value
|
||||
return Object.keys(cfg).length ? JSON.stringify(cfg) : ''
|
||||
})
|
||||
|
|
|
|||
|
|
@ -261,6 +261,11 @@ const prayBaseUrl = computed(() => props.prayBaseUrl || cfg.value.prayBaseUrl |
|
|||
// localeFromUrl() is the library's own reader, imported rather than re-implemented, so the fetch and
|
||||
// the chrome can never disagree about what the URL asked for. Same ladder regions uses
|
||||
// (region-dashboards.vue:95), and a host that passes languageCode still wins.
|
||||
// ⚠ ALL THREE SPELLINGS ARE IN USE AND `lang` HAS A CALLER. big-picture composes this grid and threads
|
||||
// the host's locale into its profile-config as `lang` (big-picture.vue, listConfig) — it cannot reach
|
||||
// this bundle any other way, because getRuntimeLocale is module state and a separately-built child gets
|
||||
// its own copy. Dropping `cfg.value.lang` from this chain would leave a composed grid in the wrong
|
||||
// language on a profile-config embed while ?lang= embeds carry on working, which is how it would ship.
|
||||
const languageCode = computed(() =>
|
||||
props.languageCode || cfg.value.languageCode || cfg.value.locale || cfg.value.lang || localeFromUrl() || '')
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue