PPLR maps: "Map unavailable" shows its words, not its key
The seven map views read the shared messages.mapUnavailable through usePplrT, which prefixes every key with pplr., so they rendered the raw key. They now read it with tStatic, which takes a qualified key and follows the page locale.
This commit is contained in:
parent
f57435253c
commit
a56d06c886
7 changed files with 14 additions and 7 deletions
|
|
@ -1,6 +1,7 @@
|
|||
<script setup>
|
||||
import { dataUrl, glFor, exposeMap, whenGeojsonDrawn } from '../utils/pplrData.js'
|
||||
import { usePplrT } from '../composables/usePplrT.js'
|
||||
import { tStatic } from '@map/i18n/index.js'
|
||||
/**
|
||||
* pplr-coverage.vue — Country choropleth: avg # of locales filled per PG in that country.
|
||||
*
|
||||
|
|
@ -56,7 +57,7 @@ onMounted(async () => {
|
|||
if (!map.value) {
|
||||
// The map did not construct (e.g. provider=mapbox with no token; useMapInstance logs why). Say so
|
||||
// and stop: everything below needs a map, and map.value.on() threw into the mounted hook.
|
||||
status.value = t('messages.mapUnavailable')
|
||||
status.value = tStatic('messages.mapUnavailable') // a shared key: usePplrT would prefix it with pplr.
|
||||
return
|
||||
}
|
||||
map.value.on('load', async () => {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<script setup>
|
||||
import { dataUrl, glFor, exposeMap, whenGeojsonDrawn, setProjectionFor } from '../utils/pplrData.js'
|
||||
import { usePplrT } from '../composables/usePplrT.js'
|
||||
import { tStatic } from '@map/i18n/index.js'
|
||||
/**
|
||||
* pplr-language-families.vue — PG pins colored by PPLR ethnolinguistic family.
|
||||
*
|
||||
|
|
@ -432,7 +433,7 @@ onMounted(async () => {
|
|||
if (!map.value) {
|
||||
// The map did not construct (e.g. provider=mapbox with no token; useMapInstance logs why). Say so
|
||||
// and stop: everything below needs a map, and map.value.on() threw into the mounted hook.
|
||||
status.value = t('messages.mapUnavailable')
|
||||
status.value = tStatic('messages.mapUnavailable') // a shared key: usePplrT would prefix it with pplr.
|
||||
return
|
||||
}
|
||||
if (map.value) {
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
import { inject, onMounted, onBeforeUnmount, ref } from 'vue'
|
||||
import { glFor, exposeMap, whenGeojsonDrawn } from '../utils/pplrData.js'
|
||||
import { usePplrT } from '../composables/usePplrT.js'
|
||||
import { tStatic } from '@map/i18n/index.js'
|
||||
import { useMapInstance } from '@map/composables/useMapInstance.js'
|
||||
import { addCountryPolygons, addPGPoints, popupForPG, POPUP_CSS } from '../utils/pplrMap.js'
|
||||
import LoadingGlobe from '../components/LoadingGlobe.vue'
|
||||
|
|
@ -40,7 +41,7 @@ onMounted(async () => {
|
|||
if (!map.value) {
|
||||
// The map did not construct (e.g. provider=mapbox with no token; useMapInstance logs why). Say so
|
||||
// and stop: everything below needs a map, and map.value.on() threw into the mounted hook.
|
||||
status.value = t('messages.mapUnavailable')
|
||||
status.value = tStatic('messages.mapUnavailable') // a shared key: usePplrT would prefix it with pplr.
|
||||
return
|
||||
}
|
||||
map.value.on('load', async () => {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<script setup>
|
||||
import { dataUrl, glFor, exposeMap, whenGeojsonDrawn, setProjectionFor } from '../utils/pplrData.js'
|
||||
import { usePplrT } from '../composables/usePplrT.js'
|
||||
import { tStatic } from '@map/i18n/index.js'
|
||||
/**
|
||||
* pplr-religion.vue — PG pins colored by primary religion.
|
||||
*
|
||||
|
|
@ -250,7 +251,7 @@ onMounted(async () => {
|
|||
if (!map.value) {
|
||||
// The map did not construct (e.g. provider=mapbox with no token; useMapInstance logs why). Say so
|
||||
// and stop: everything below needs a map, and map.value.on() threw into the mounted hook.
|
||||
status.value = t('messages.mapUnavailable')
|
||||
status.value = tStatic('messages.mapUnavailable') // a shared key: usePplrT would prefix it with pplr.
|
||||
return
|
||||
}
|
||||
if (map.value) {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<script setup>
|
||||
import { dataUrl, glFor, exposeMap, setProjectionFor } from '../utils/pplrData.js'
|
||||
import { usePplrT } from '../composables/usePplrT.js'
|
||||
import { tStatic } from '@map/i18n/index.js'
|
||||
/**
|
||||
* pplr-rop-tree.vue — ROP hierarchy: Affinity Bloc → Cluster → People Group → PGIC.
|
||||
*
|
||||
|
|
@ -399,7 +400,7 @@ onMounted(async () => {
|
|||
if (!map.value) {
|
||||
// The map did not construct (e.g. provider=mapbox with no token; useMapInstance logs why). Say so
|
||||
// and stop: everything below needs a map, and map.value.on() threw into the mounted hook.
|
||||
status.value = t('messages.mapUnavailable')
|
||||
status.value = tStatic('messages.mapUnavailable') // a shared key: usePplrT would prefix it with pplr.
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
import { inject, onMounted, onBeforeUnmount, ref } from 'vue'
|
||||
import { glFor, exposeMap, whenGeojsonDrawn } from '../utils/pplrData.js'
|
||||
import { usePplrT } from '../composables/usePplrT.js'
|
||||
import { tStatic } from '@map/i18n/index.js'
|
||||
import { useMapInstance } from '@map/composables/useMapInstance.js'
|
||||
import { addCountryPolygons, loadOnce, popupForPG, POPUP_CSS, escHtml } from '../utils/pplrMap.js'
|
||||
import LoadingGlobe from '../components/LoadingGlobe.vue'
|
||||
|
|
@ -48,7 +49,7 @@ onMounted(async () => {
|
|||
if (!map.value) {
|
||||
// The map did not construct (e.g. provider=mapbox with no token; useMapInstance logs why). Say so
|
||||
// and stop: everything below needs a map, and map.value.on() threw into the mounted hook.
|
||||
status.value = t('messages.mapUnavailable')
|
||||
status.value = tStatic('messages.mapUnavailable') // a shared key: usePplrT would prefix it with pplr.
|
||||
return
|
||||
}
|
||||
map.value.on('load', async () => {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<script setup>
|
||||
import { dataUrl, glFor, exposeMap, whenGeojsonDrawn } from '../utils/pplrData.js'
|
||||
import { usePplrT } from '../composables/usePplrT.js'
|
||||
import { tStatic } from '@map/i18n/index.js'
|
||||
/**
|
||||
* pplr-translations.vue — PG name in all 17 locales.
|
||||
*
|
||||
|
|
@ -62,7 +63,7 @@ onMounted(async () => {
|
|||
if (!map.value) {
|
||||
// The map did not construct (e.g. provider=mapbox with no token; useMapInstance logs why). Say so
|
||||
// and stop: everything below needs a map, and map.value.on() threw into the mounted hook.
|
||||
status.value = t('messages.mapUnavailable')
|
||||
status.value = tStatic('messages.mapUnavailable') // a shared key: usePplrT would prefix it with pplr.
|
||||
return
|
||||
}
|
||||
if (map.value) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue