From 5643981601bda11ad18b57c5f89d189a2c0c0d2b Mon Sep 17 00:00:00 2001 From: Doxa Maps Date: Sat, 26 Sep 2026 18:02:21 +0000 Subject: [PATCH] Cities with Internet: the basemap's place names follow the reader's language Under ar, Cities with Internet showed an Arabic legend over English country and city names, while Prayer Progress localized its basemap. The helper already exists in the library: localizeBasemapLabels (library/maps/localize-labels.js), which is Mapbox setLanguage, and on MapLibre points each OSM-name label layer at name:, then name:latin, then name. useMapInstance applies it for every map built through it; connectivity-map builds its map raw (new gl.Map), so it never ran here. It now runs on 'load' with the same reader-language ladder the engine UI labels use. No library change: the helper was already shared. Headless, the real helper against engine-shaped maps: under MapLibre ar, the 2 basemap label layers are rewritten and the plugin's own label (['get','iso3']) is untouched; en restores the originals exactly. Under Mapbox ar-EG, setLanguage('ar') is called. Build OK; no-free-identifiers, universal-props and profiles-mount pass. --- plugin-designs/cities-internet/connectivity-map.vue | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugin-designs/cities-internet/connectivity-map.vue b/plugin-designs/cities-internet/connectivity-map.vue index cba469537..4745f3540 100644 --- a/plugin-designs/cities-internet/connectivity-map.vue +++ b/plugin-designs/cities-internet/connectivity-map.vue @@ -50,6 +50,7 @@ import ShareButton from '@map/components/map-controls/ShareButton.vue' import { resolveAssetsBase } from '@map/utils/embedBase.js' import { resolveMapProvider } from '@map/composables/useMapProvider.js' import { ensureEngineScript, engineGlobal, ensureEngineCSS, engineStylesheetUrl, engineUiLocale } from '@map/composables/useMapInstance.js' +import { localizeBasemapLabels } from '@map/maps/localize-labels.js' import { resolveNamedStyle } from '@map/styles/registry.js' import { installRtlTextPlugin } from '@map/maps/rtl-text.js' // People-group dots open the SAME detail panel as Prayer Progress (doxa-simple-map): the @@ -417,6 +418,10 @@ onMounted(async () => { // countries carrying a real attribution requirement (India CC BY 2.5 IN, etc). addMapAttribution(map, { boundaries: true }) map.once('load', async () => { + // The BASEMAP's place names in the reader's language (Mapbox setLanguage / MapLibre name:), + // the library's own helper. useMapInstance applies it for every map built through it; this map is + // built raw, so it was the one map whose country and city names stayed English under ar. + try { localizeBasemapLabels(map, readerLang()) } catch (_) { /* a nicety lost, never a broken map */ } paint(map, adm0) selectedPin.initialize() await groupsLoaded