Skip to content

Commit 9770a0a

Browse files
Felix Sommersommerfe
authored andcommitted
PB-1878: add translations
1 parent 4dc249b commit 9770a0a

7 files changed

Lines changed: 21 additions & 18 deletions

File tree

packages/mapviewer/src/modules/i18n/locales/de.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,8 @@
488488
"offline_refresh": "Seite aktualisieren",
489489
"offline_save": "Karte Speichern",
490490
"offline_save_new_data": "Neue Karte speichern ",
491+
"offline_sw_configuration_error": "Fehler in der Service-Worker-Konfiguration. Die Offline-Funktionalität funktioniert möglicherweise nicht korrekt.",
492+
"offline_sw_secure_context_required": "Der Service Worker erfordert einen sicheren Kontext (HTTPS mit einem vertrauenswürdigen Zertifikat).",
491493
"offline_save_warning": "- ~50MB Kartenmaterial wird heruntergeladen werden (bis Massstab 1:25'000) - Bitte diese Seite während dem Speichervorgang nicht verlassen und das Gerät nicht sperren. \\\"Private\\\" mode des Browsers muss deaktiviert sein.",
492494
"offline_show": "Zeige Offline Menu",
493495
"offline_show_extent": "Ausschnitt anzeigen",
@@ -755,4 +757,4 @@
755757
"zoom_in": "Vergrössere Kartenausschnitt",
756758
"zoom_out": "Verkleinere Kartenausschnitt",
757759
"zooming_mode_warning": "Zum Zoomen der Karte Strg/Cmd gedrückt halten"
758-
}
760+
}

packages/mapviewer/src/modules/i18n/locales/en.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,8 @@
488488
"offline_refresh": "Refresh the page",
489489
"offline_save": "Save map",
490490
"offline_save_new_data": "Save new map",
491+
"offline_sw_configuration_error": "Service worker configuration error. Offline functionality may not work correctly.",
492+
"offline_sw_secure_context_required": "Service worker requires a secure context (HTTPS with a trusted certificate).",
491493
"offline_save_warning": "- ~50MB of maps will be downloaded (until scale 1:25'000) - Don't lock your device or navigate away from this site during the download process. Deactivate \\\"private\\\" mode of your browser.",
492494
"offline_show": "Show offline menu",
493495
"offline_show_extent": "Show extent",
@@ -755,4 +757,4 @@
755757
"zoom_in": "Zoom in",
756758
"zoom_out": "Zoom out",
757759
"zooming_mode_warning": "Hold Ctrl/Cmd while scrolling to zoom the map"
758-
}
760+
}

packages/mapviewer/src/modules/i18n/locales/fr.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,8 @@
488488
"offline_refresh": "Rafraîchir la page",
489489
"offline_save": "Enregistrer carte",
490490
"offline_save_new_data": "Sauvegarder une nouvelle carte",
491+
"offline_sw_configuration_error": "Erreur de configuration du service worker. Le mode hors ligne pourrait ne pas fonctionner correctement.",
492+
"offline_sw_secure_context_required": "Le service worker nécessite un contexte sécurisé (HTTPS avec un certificat de confiance).",
491493
"offline_save_warning": "- Vous allez télécharger ~50MB de carte (jusqu'à l'échelle 1:25'000) - Ne lockez pas votre appareil et ne quittez pas ce site durant le processus de téléchargement. Désactivez le mode « privé »",
492494
"offline_show": "Afficher le menu hors-ligne",
493495
"offline_show_extent": "Afficher l'étendue",
@@ -755,4 +757,4 @@
755757
"zoom_in": "Zoomer plus",
756758
"zoom_out": "Zoomer moins",
757759
"zooming_mode_warning": "Maintenir Ctrl/Cmd pour zoomer sur la carte"
758-
}
760+
}

packages/mapviewer/src/modules/i18n/locales/it.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,8 @@
488488
"offline_refresh": "Ricarica la pagina",
489489
"offline_save": "Salvare la mappa",
490490
"offline_save_new_data": "Salvare una nuova mappa",
491+
"offline_sw_configuration_error": "Errore di configurazione del service worker. La funzionalità offline potrebbe non funzionare correttamente.",
492+
"offline_sw_secure_context_required": "Il service worker richiede un contesto sicuro (HTTPS con un certificato attendibile).",
491493
"offline_save_warning": "- Saranno scaricati ~50MB di carte (fino alla scala 1:25000) - Non bloccare il dispositivo e non abbandonare questa pagina durante il download. Disattivare la modalità \\\"privata\\\"",
492494
"offline_show": "Mostra il menu offline",
493495
"offline_show_extent": "Mostrare l'estensione",
@@ -755,4 +757,4 @@
755757
"zoom_in": "Zoom in avanti",
756758
"zoom_out": "Zoom indietro",
757759
"zooming_mode_warning": "Mantenere Ctrl/Cmd premuto per zoomare la mappa"
758-
}
760+
}

packages/mapviewer/src/modules/i18n/locales/rm.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,8 @@
488488
"offline_refresh": "Chargiar giu la pagina",
489489
"offline_save": "Arcurnar charta",
490490
"offline_save_new_data": "Memorisar la nova charta",
491+
"offline_sw_configuration_error": "Errur da configuraziun dal service worker. La funcziunalitad offline pudess betg funcziunar correctamain.",
492+
"offline_sw_secure_context_required": "Il service worker pretenda in context segir (HTTPS cun in certificat fidà).",
491493
"offline_save_warning": "Chargiar e memorisar la charta d'ina grondezza da ~50MB?",
492494
"offline_show": "Mussar il menu offline",
493495
"offline_show_extent": "Mussar l'extract",
@@ -755,4 +757,4 @@
755757
"zoom_in": "Engrondir l'extract da la charta",
756758
"zoom_out": "Empitschnir l'extract da la charta",
757759
"zooming_mode_warning": "egnair Ctrl/Cmd cuntschaint per zoomar la charta"
758-
}
760+
}

packages/mapviewer/src/utils/offline/OfflineReadinessStatus.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -219,10 +219,10 @@ const tooltipContent = computed<string>(() => {
219219
const title = t('offline_modal_title')
220220
let extraInfoKey = 'wait_data_loading'
221221
if (swInsecureContext.value) {
222-
return `${title}: Service worker requires a secure context (HTTPS with a trusted certificate).`
222+
return `${title}: ${t('offline_sw_secure_context_required')}`
223223
}
224224
if (swValidationFailed.value) {
225-
return `${title}: Service worker configuration error. Offline functionality may not work correctly.`
225+
return `${title}: ${t('offline_sw_configuration_error')}`
226226
}
227227
if (needRefresh.value) {
228228
extraInfoKey = 'offline_cache_obsolete'
@@ -296,10 +296,10 @@ function refreshCache() {
296296
size="sm"
297297
/>
298298
<span v-if="withText && swInsecureContext">
299-
Service worker requires HTTPS with a trusted certificate
299+
{{ t('offline_sw_secure_context_required') }}
300300
</span>
301301
<span v-if="withText && swValidationFailed">
302-
Service worker configuration error
302+
{{ t('offline_sw_configuration_error') }}
303303
</span>
304304
<span v-if="withText && !swValidationFailed && !offlineReady && !needRefresh">
305305
{{ t('wait_data_loading') }}

packages/mapviewer/vite-plugins/vite-plugin-move-sw.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable no-console */
12
/**
23
* Vite plugin that moves the generated service worker file to a versioned directory.
34
*
@@ -18,7 +19,6 @@ export default function moveServiceWorkerFile(appVersion) {
1819
const fs = await import('fs/promises')
1920
const path = await import('path')
2021

21-
// eslint-disable-next-line no-console
2222
console.log('[vite-plugin-move-sw] Moving service worker to versioned directory...')
2323

2424
const swFileName = 'service-workers.js'
@@ -39,7 +39,6 @@ export default function moveServiceWorkerFile(appVersion) {
3939

4040
// Copy the service worker file to versioned location
4141
await fs.copyFile(oldSwPath, newSwPath)
42-
// eslint-disable-next-line no-console
4342
console.log(`[vite-plugin-move-sw] Copied ${swFileName} to ${appVersion}/`)
4443

4544
// Keep a scope-safe bootstrap file at root that imports the versioned SW script
@@ -48,7 +47,6 @@ export default function moveServiceWorkerFile(appVersion) {
4847
`/* generated by vite-plugin-move-sw */\nimportScripts('./${appVersion}/service-workers.js')\n`,
4948
'utf-8'
5049
)
51-
// eslint-disable-next-line no-console
5250
console.log('[vite-plugin-move-sw] Created root SW bootstrap loader')
5351

5452
// Handle source map if it exists
@@ -57,7 +55,6 @@ export default function moveServiceWorkerFile(appVersion) {
5755

5856
// Copy the source map file
5957
await fs.copyFile(oldSwMapPath, newSwMapPath)
60-
// eslint-disable-next-line no-console
6158
console.log(`[vite-plugin-move-sw] Copied ${swMapFileName} to ${appVersion}/`)
6259

6360
// Update source map reference in the JS file
@@ -68,18 +65,14 @@ export default function moveServiceWorkerFile(appVersion) {
6865
)
6966

7067
await fs.writeFile(newSwPath, updatedContent, 'utf-8')
71-
// eslint-disable-next-line no-console
7268
console.log('[vite-plugin-move-sw] Updated source map reference')
7369
} catch {
7470
// Source map doesn't exist, which is fine
75-
// eslint-disable-next-line no-console
7671
console.log('[vite-plugin-move-sw] No source map found (this is OK)')
7772
}
78-
79-
// eslint-disable-next-line no-console
8073
console.log('[vite-plugin-move-sw] Service worker relocation complete')
8174
} catch (error) {
82-
this.warn(
75+
console.warn(
8376
`[vite-plugin-move-sw] WARNING: Failed to move service worker file: ${error.message}. ` +
8477
`Expected file at: ${oldSwPath}. SW versioning may have failed.`
8578
)

0 commit comments

Comments
 (0)