From 36ad9ae73ccc6b6228275e46115c1268d9220fe4 Mon Sep 17 00:00:00 2001 From: Doxa Maps Date: Sat, 26 Sep 2026 12:35:20 +0000 Subject: [PATCH] The engine logo's label follows the reader's language, on both engines MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit rega's row 34 (map controls in ar) found the engine logo's label English: "Mapbox homepage" / "MapLibre logo" — one engine key with two meanings. engineUiLocale(lang, provider) now takes the engine and sets LogoControl.Title from mapui.mapboxHomepage or mapui.maplibreLogo (11 locales). gospel-resources and cities-internet build their maps RAW; engineUiLocale is documented as exported for them. (PinHint's close button was already translated on main as aria.dismissHint.) --- library/composables/useMapInstance.js | 13 +++++++++---- library/i18n/locales/ar/mapui.json | 4 +++- library/i18n/locales/de/mapui.json | 4 +++- library/i18n/locales/en/mapui.json | 4 +++- library/i18n/locales/es/mapui.json | 4 +++- library/i18n/locales/fr/mapui.json | 4 +++- library/i18n/locales/hi/mapui.json | 4 +++- library/i18n/locales/it/mapui.json | 4 +++- library/i18n/locales/pt/mapui.json | 4 +++- library/i18n/locales/ro/mapui.json | 4 +++- library/i18n/locales/ru/mapui.json | 4 +++- library/i18n/locales/zh/mapui.json | 4 +++- 12 files changed, 42 insertions(+), 15 deletions(-) diff --git a/library/composables/useMapInstance.js b/library/composables/useMapInstance.js index be7b8dfb0..cf0d75b2b 100644 --- a/library/composables/useMapInstance.js +++ b/library/composables/useMapInstance.js @@ -41,7 +41,9 @@ const ENGINES = { // THE ENGINE'S OWN CONTROL LABELS ("Zoom in", "Toggle attribution", the gesture hints…) in the reader's // language. Both engines take a `locale` map of their UI strings at construction; without one they stay // English under ar/es (rega's row 30). Strings live in library/i18n/locales//mapui.json. The keys are -// the engines' own; an engine ignores the ones it does not use. +// the engines' own; an engine ignores the ones it does not use. EXPORTED for the maps built RAW +// (new gl.Map outside this composable, e.g. gospel-resources, cities-internet): pass +// `locale: engineUiLocale(lang, provider)` to their constructor, or their controls stay English. const ENGINE_UI_KEYS = { 'Map.Title': 'map', 'Marker.Title': 'marker', 'Popup.Close': 'closePopup', 'NavigationControl.ZoomIn': 'zoomIn', 'NavigationControl.ZoomOut': 'zoomOut', 'NavigationControl.ResetBearing': 'resetBearing', @@ -54,12 +56,15 @@ const ENGINE_UI_KEYS = { // Mapbox's names for the same gesture hints 'ScrollZoomBlocker.CtrlMessage': 'ctrlScroll', 'ScrollZoomBlocker.CmdMessage': 'cmdScroll', 'TouchPanBlocker.Message': 'twoFingers', } -export function engineUiLocale(lang) { +export function engineUiLocale(lang, provider) { const out = {} for (const [engineKey, ours] of Object.entries(ENGINE_UI_KEYS)) { const v = tStatic(`mapui.${ours}`, lang) if (v) out[engineKey] = v } + // The logo's label names its own engine ("Mapbox homepage" / "MapLibre logo"): one key, two meanings. + const logo = tStatic(provider === 'maplibre' ? 'mapui.maplibreLogo' : 'mapui.mapboxHomepage', lang) + if (logo) out['LogoControl.Title'] = logo return out } @@ -541,7 +546,7 @@ export function useMapInstance({ // day/night decision, not a guess made here. (Computed above the branch: the Mapbox // branch's own `initialConfig` is scoped to that branch and is NOT visible here.) style: maplibreStyle(effectiveStyle, _bootPreset), - locale: engineUiLocale(readerLang()), + locale: engineUiLocale(readerLang(), 'maplibre'), center, zoom, minZoom: initialMinZoom, @@ -568,7 +573,7 @@ export function useMapInstance({ accessToken: token, // BP #1 from W1A — per-instance token; avoids last-writer-wins on multi-embed pages container: containerRef.value, // real DOM element — never a string ID in shadow DOM style: effectiveStyle, - locale: engineUiLocale(readerLang()), + locale: engineUiLocale(readerLang(), 'mapbox'), // Pins a Standard basemap's lightPreset/theme BEFORE its first frame; without it the // schema default 'day' paints one LIGHT frame before any setConfigProperty can run. ...(initialConfig ? { config: initialConfig } : {}), diff --git a/library/i18n/locales/ar/mapui.json b/library/i18n/locales/ar/mapui.json index 2794241db..bfdda1f81 100644 --- a/library/i18n/locales/ar/mapui.json +++ b/library/i18n/locales/ar/mapui.json @@ -15,5 +15,7 @@ "disableGlobe": "إيقاف الكرة الأرضية", "ctrlScroll": "استخدم Ctrl مع التمرير لتكبير الخريطة", "cmdScroll": "استخدم ⌘ مع التمرير لتكبير الخريطة", - "twoFingers": "استخدم إصبعين لتحريك الخريطة" + "twoFingers": "استخدم إصبعين لتحريك الخريطة", + "mapboxHomepage": "الصفحة الرئيسية لـ Mapbox", + "maplibreLogo": "شعار MapLibre" } diff --git a/library/i18n/locales/de/mapui.json b/library/i18n/locales/de/mapui.json index b7adb5a19..d09ad2261 100644 --- a/library/i18n/locales/de/mapui.json +++ b/library/i18n/locales/de/mapui.json @@ -15,5 +15,7 @@ "disableGlobe": "Globus ausschalten", "ctrlScroll": "Strg + Scrollen zum Zoomen der Karte", "cmdScroll": "⌘ + Scrollen zum Zoomen der Karte", - "twoFingers": "Mit zwei Fingern die Karte bewegen" + "twoFingers": "Mit zwei Fingern die Karte bewegen", + "mapboxHomepage": "Mapbox-Startseite", + "maplibreLogo": "MapLibre-Logo" } diff --git a/library/i18n/locales/en/mapui.json b/library/i18n/locales/en/mapui.json index a48e51a4c..693fc8c33 100644 --- a/library/i18n/locales/en/mapui.json +++ b/library/i18n/locales/en/mapui.json @@ -15,5 +15,7 @@ "disableGlobe": "Disable globe", "ctrlScroll": "Use Ctrl + scroll to zoom the map", "cmdScroll": "Use ⌘ + scroll to zoom the map", - "twoFingers": "Use two fingers to move the map" + "twoFingers": "Use two fingers to move the map", + "mapboxHomepage": "Mapbox homepage", + "maplibreLogo": "MapLibre logo" } diff --git a/library/i18n/locales/es/mapui.json b/library/i18n/locales/es/mapui.json index a4fb8b933..d604a62b3 100644 --- a/library/i18n/locales/es/mapui.json +++ b/library/i18n/locales/es/mapui.json @@ -15,5 +15,7 @@ "disableGlobe": "Desactivar globo", "ctrlScroll": "Usa Ctrl + desplazamiento para hacer zoom en el mapa", "cmdScroll": "Usa ⌘ + desplazamiento para hacer zoom en el mapa", - "twoFingers": "Usa dos dedos para mover el mapa" + "twoFingers": "Usa dos dedos para mover el mapa", + "mapboxHomepage": "Página de inicio de Mapbox", + "maplibreLogo": "Logotipo de MapLibre" } diff --git a/library/i18n/locales/fr/mapui.json b/library/i18n/locales/fr/mapui.json index eb0154d14..5c02f43b0 100644 --- a/library/i18n/locales/fr/mapui.json +++ b/library/i18n/locales/fr/mapui.json @@ -15,5 +15,7 @@ "disableGlobe": "Désactiver le globe", "ctrlScroll": "Utilisez Ctrl + molette pour zoomer sur la carte", "cmdScroll": "Utilisez ⌘ + molette pour zoomer sur la carte", - "twoFingers": "Utilisez deux doigts pour déplacer la carte" + "twoFingers": "Utilisez deux doigts pour déplacer la carte", + "mapboxHomepage": "Page d'accueil de Mapbox", + "maplibreLogo": "Logo MapLibre" } diff --git a/library/i18n/locales/hi/mapui.json b/library/i18n/locales/hi/mapui.json index 3a70a993c..2a8de50ea 100644 --- a/library/i18n/locales/hi/mapui.json +++ b/library/i18n/locales/hi/mapui.json @@ -15,5 +15,7 @@ "disableGlobe": "ग्लोब बंद करें", "ctrlScroll": "मानचित्र ज़ूम करने के लिए Ctrl + स्क्रॉल करें", "cmdScroll": "मानचित्र ज़ूम करने के लिए ⌘ + स्क्रॉल करें", - "twoFingers": "मानचित्र हिलाने के लिए दो उँगलियों का उपयोग करें" + "twoFingers": "मानचित्र हिलाने के लिए दो उँगलियों का उपयोग करें", + "mapboxHomepage": "Mapbox मुखपृष्ठ", + "maplibreLogo": "MapLibre लोगो" } diff --git a/library/i18n/locales/it/mapui.json b/library/i18n/locales/it/mapui.json index d295f8606..7a4350700 100644 --- a/library/i18n/locales/it/mapui.json +++ b/library/i18n/locales/it/mapui.json @@ -15,5 +15,7 @@ "disableGlobe": "Disattiva globo", "ctrlScroll": "Usa Ctrl + scorrimento per ingrandire la mappa", "cmdScroll": "Usa ⌘ + scorrimento per ingrandire la mappa", - "twoFingers": "Usa due dita per spostare la mappa" + "twoFingers": "Usa due dita per spostare la mappa", + "mapboxHomepage": "Home page di Mapbox", + "maplibreLogo": "Logo di MapLibre" } diff --git a/library/i18n/locales/pt/mapui.json b/library/i18n/locales/pt/mapui.json index d95d6a6fa..f5b64b7ba 100644 --- a/library/i18n/locales/pt/mapui.json +++ b/library/i18n/locales/pt/mapui.json @@ -15,5 +15,7 @@ "disableGlobe": "Desativar globo", "ctrlScroll": "Use Ctrl + rolagem para ampliar o mapa", "cmdScroll": "Use ⌘ + rolagem para ampliar o mapa", - "twoFingers": "Use dois dedos para mover o mapa" + "twoFingers": "Use dois dedos para mover o mapa", + "mapboxHomepage": "Página inicial do Mapbox", + "maplibreLogo": "Logótipo do MapLibre" } diff --git a/library/i18n/locales/ro/mapui.json b/library/i18n/locales/ro/mapui.json index f6420e37c..c61b1efd8 100644 --- a/library/i18n/locales/ro/mapui.json +++ b/library/i18n/locales/ro/mapui.json @@ -15,5 +15,7 @@ "disableGlobe": "Dezactivează globul", "ctrlScroll": "Folosește Ctrl + derulare pentru a mări harta", "cmdScroll": "Folosește ⌘ + derulare pentru a mări harta", - "twoFingers": "Folosește două degete pentru a muta harta" + "twoFingers": "Folosește două degete pentru a muta harta", + "mapboxHomepage": "Pagina principală Mapbox", + "maplibreLogo": "Sigla MapLibre" } diff --git a/library/i18n/locales/ru/mapui.json b/library/i18n/locales/ru/mapui.json index 1800ef058..bcdec1bdf 100644 --- a/library/i18n/locales/ru/mapui.json +++ b/library/i18n/locales/ru/mapui.json @@ -15,5 +15,7 @@ "disableGlobe": "Выключить глобус", "ctrlScroll": "Используйте Ctrl + прокрутку для масштабирования карты", "cmdScroll": "Используйте ⌘ + прокрутку для масштабирования карты", - "twoFingers": "Используйте два пальца, чтобы перемещать карту" + "twoFingers": "Используйте два пальца, чтобы перемещать карту", + "mapboxHomepage": "Главная страница Mapbox", + "maplibreLogo": "Логотип MapLibre" } diff --git a/library/i18n/locales/zh/mapui.json b/library/i18n/locales/zh/mapui.json index b2bcbc51d..d8fa5c361 100644 --- a/library/i18n/locales/zh/mapui.json +++ b/library/i18n/locales/zh/mapui.json @@ -15,5 +15,7 @@ "disableGlobe": "停用地球仪", "ctrlScroll": "使用 Ctrl + 滚轮缩放地图", "cmdScroll": "使用 ⌘ + 滚轮缩放地图", - "twoFingers": "使用两根手指移动地图" + "twoFingers": "使用两根手指移动地图", + "mapboxHomepage": "Mapbox 主页", + "maplibreLogo": "MapLibre 标志" }