Big Picture: read the language the host asked for

Embedded with profile-config {"locale":"ar"} this leaf drew no Arabic at all,
while the same page reached with ?lang=ar drew 273 characters of it.

Its two siblings were fixed two different ways and neither applies here. This
bundle's entry calls defineCustomElement with no configureApp: there is no i18n
instance for install-time provide to reach, and no ProfileLoader beneath it to
drive one. Everything this element renders comes through tStatic — the grid's
`t` proxy, the header's labels — and tStatic resolves the locale from the URL
and the document, neither of which a host's profile-config touches.

So the only thing missing was somebody to say which language this page is being
read in, which is the same six lines the other two composites already carry.

MEASURED with check:host-locale-contract:
    big-picture/big-picture   host 0 of 273  ->  host 273 of 273
    whole fleet               1 failing      ->  PASS, 32 leaves
This commit is contained in:
doxa-maps-88655c70 2026-09-25 15:15:55 +00:00
parent 519d5c80ef
commit 8b40f6c585
8 changed files with 38 additions and 22 deletions

View file

@ -48,7 +48,8 @@
*
* Becomes tab-1 of the Cat-5 SPA.
*/
import { computed, reactive, ref } from 'vue'
import { computed, reactive, ref, watchEffect } from 'vue'
import { SUPPORTED_LOCALES, setRuntimeLocale } from '@map/i18n/index.js'
import BpResearchHeader from './src/components/BpResearchHeader.vue'
// The REAL cap-2 grid — same component the standalone <people-groups-grid> ships (no fork).
import PeopleGroupsGrid from '../people-groups-grid/people-groups-grid.vue'
@ -63,6 +64,21 @@ const config = computed(() => {
})
const accent = computed(() => config.value.accent || '#8b5cf6')
const heading = computed(() => config.value.title || 'Big Picture — Unified Research Dashboard')
// ★ THE LOCALE THE HOST ASKED FOR, AND THE ONE ELEMENT ON THE PAGE THAT CAN ACT ON IT.
// MEASURED with check:host-locale-contract: this leaf drew 0 Arabic characters for
// profile-config {"locale":"ar"} against 273 for the same page reached with ?lang=ar. Its siblings
// were fixed two different ways and neither applies here — this bundle's entry calls
// defineCustomElement(BigPicture) with no configureApp at all, so there is no i18n instance for
// provide-on-install to reach and no ProfileLoader anywhere beneath to drive one. Every string this
// element renders comes through tStatic (the grid's `t` proxy, the header's labels), and tStatic
// resolves the locale from the URL and the document — neither of which a host's profile-config
// touches. So the only thing missing was somebody to say which language this page is being read in.
const hostLang = computed(() => {
const l = String(config.value.locale || config.value.lang || '').split('-')[0].toLowerCase()
return SUPPORTED_LOCALES.includes(l) ? l : ''
})
watchEffect(() => { if (hostLang.value) setRuntimeLocale(hostLang.value) })
const prayBaseUrl = computed(() => config.value.prayBaseUrl || '')
const languageCode = computed(() => config.value.languageCode || '')

File diff suppressed because one or more lines are too long

View file

@ -37,7 +37,7 @@
<script>window.MAP_APP_API_URL = "https://pray.doxa.life";</script>
<!-- Bundle IIFE — registers the <bp-big-picture> custom element. -->
<script src="../../big-picture.js" integrity="sha384-LJXi3Gt0KWHiSDqvUWGeJgvq/r71K6UlZpZJcOYmk8V3v05vl/ZlfSPh8vQ4QUh7" crossorigin="anonymous"></script>
<script src="../../big-picture.js" integrity="sha384-A9HaFVBmcChkzSgammNp5l6nLtN/UFSZphZumbhcsK1A6fTsGorQlcCelIEqxZm7" crossorigin="anonymous"></script>
<script>
// Mapbox token resolution — the A3 ladder, in precedence order:

View file

@ -37,7 +37,7 @@
<script>window.MAP_APP_API_URL = "https://pray.doxa.life";</script>
<!-- Bundle IIFE — registers the <bp-big-picture> custom element. -->
<script src="../../big-picture.js" integrity="sha384-LJXi3Gt0KWHiSDqvUWGeJgvq/r71K6UlZpZJcOYmk8V3v05vl/ZlfSPh8vQ4QUh7" crossorigin="anonymous"></script>
<script src="../../big-picture.js" integrity="sha384-A9HaFVBmcChkzSgammNp5l6nLtN/UFSZphZumbhcsK1A6fTsGorQlcCelIEqxZm7" crossorigin="anonymous"></script>
<script>
// Mapbox token resolution — the A3 ladder, in precedence order:

View file

@ -37,7 +37,7 @@
<script>window.MAP_APP_API_URL = "https://pray.doxa.life";</script>
<!-- Bundle IIFE — registers the <bp-big-picture> custom element. -->
<script src="../big-picture.js" integrity="sha384-LJXi3Gt0KWHiSDqvUWGeJgvq/r71K6UlZpZJcOYmk8V3v05vl/ZlfSPh8vQ4QUh7" crossorigin="anonymous"></script>
<script src="../big-picture.js" integrity="sha384-A9HaFVBmcChkzSgammNp5l6nLtN/UFSZphZumbhcsK1A6fTsGorQlcCelIEqxZm7" crossorigin="anonymous"></script>
<script>
// Mapbox token resolution — the A3 ladder, in precedence order:

View file

@ -39,7 +39,7 @@
"bundle": "big-picture",
"scriptUrl": "./big-picture/big-picture.js",
"output": "doxa-maps/big-picture/big-picture.js",
"integrity": "sha384-LJXi3Gt0KWHiSDqvUWGeJgvq/r71K6UlZpZJcOYmk8V3v05vl/ZlfSPh8vQ4QUh7",
"integrity": "sha384-A9HaFVBmcChkzSgammNp5l6nLtN/UFSZphZumbhcsK1A6fTsGorQlcCelIEqxZm7",
"elements": [
"bp-big-picture",
"bp-research-header",
@ -61,7 +61,7 @@
"scriptUrl": "./big-picture/big-picture.js",
"embed": {
"iframe": "<iframe src=\"./big-picture/big-picture/index.html?utm_source=YOUR_SOURCE\" width=\"100%\" height=\"600\" style=\"border:none;border-radius:12px;\" allowfullscreen></iframe>",
"script": "<script>window.MAP_APP_API_URL=\"https://pray.doxa.life\";</script>\n<script src=\"./big-picture/big-picture.js\" integrity=\"sha384-LJXi3Gt0KWHiSDqvUWGeJgvq/r71K6UlZpZJcOYmk8V3v05vl/ZlfSPh8vQ4QUh7\" crossorigin=\"anonymous\"></script>\n<bp-big-picture profile-config='{\"profile\":\"big-picture\",\"tk\":\"YOUR_MAPBOX_TOKEN\",\"utmSource\":\"YOUR_SOURCE\",\"assetsBase\":\"YOUR_TREE_URL/assets\"}'></bp-big-picture>"
"script": "<script>window.MAP_APP_API_URL=\"https://pray.doxa.life\";</script>\n<script src=\"./big-picture/big-picture.js\" integrity=\"sha384-A9HaFVBmcChkzSgammNp5l6nLtN/UFSZphZumbhcsK1A6fTsGorQlcCelIEqxZm7\" crossorigin=\"anonymous\"></script>\n<bp-big-picture profile-config='{\"profile\":\"big-picture\",\"tk\":\"YOUR_MAPBOX_TOKEN\",\"utmSource\":\"YOUR_SOURCE\",\"assetsBase\":\"YOUR_TREE_URL/assets\"}'></bp-big-picture>"
},
"instances": [
{

File diff suppressed because one or more lines are too long

View file

@ -39,7 +39,7 @@
"bundle": "big-picture",
"scriptUrl": "./big-picture/big-picture.js",
"output": "doxa-maps/big-picture/big-picture.js",
"integrity": "sha384-LJXi3Gt0KWHiSDqvUWGeJgvq/r71K6UlZpZJcOYmk8V3v05vl/ZlfSPh8vQ4QUh7",
"integrity": "sha384-A9HaFVBmcChkzSgammNp5l6nLtN/UFSZphZumbhcsK1A6fTsGorQlcCelIEqxZm7",
"elements": [
"bp-big-picture",
"bp-research-header",
@ -61,7 +61,7 @@
"scriptUrl": "./big-picture/big-picture.js",
"embed": {
"iframe": "<iframe src=\"./big-picture/big-picture/index.html?utm_source=YOUR_SOURCE\" width=\"100%\" height=\"600\" style=\"border:none;border-radius:12px;\" allowfullscreen></iframe>",
"script": "<script>window.MAP_APP_API_URL=\"https://pray.doxa.life\";</script>\n<script src=\"./big-picture/big-picture.js\" integrity=\"sha384-LJXi3Gt0KWHiSDqvUWGeJgvq/r71K6UlZpZJcOYmk8V3v05vl/ZlfSPh8vQ4QUh7\" crossorigin=\"anonymous\"></script>\n<bp-big-picture profile-config='{\"profile\":\"big-picture\",\"tk\":\"YOUR_MAPBOX_TOKEN\",\"utmSource\":\"YOUR_SOURCE\",\"assetsBase\":\"YOUR_TREE_URL/assets\"}'></bp-big-picture>"
"script": "<script>window.MAP_APP_API_URL=\"https://pray.doxa.life\";</script>\n<script src=\"./big-picture/big-picture.js\" integrity=\"sha384-A9HaFVBmcChkzSgammNp5l6nLtN/UFSZphZumbhcsK1A6fTsGorQlcCelIEqxZm7\" crossorigin=\"anonymous\"></script>\n<bp-big-picture profile-config='{\"profile\":\"big-picture\",\"tk\":\"YOUR_MAPBOX_TOKEN\",\"utmSource\":\"YOUR_SOURCE\",\"assetsBase\":\"YOUR_TREE_URL/assets\"}'></bp-big-picture>"
},
"instances": [
{