fix(dev): veralteten PWA-Cache bereinigen, damit i18n-Labels laden

Stale Service-Worker-Precache konnte Vite-Module und Locale-Bundles
überlagern, sodass Kompass-Dial-Texte als Roh-i18n-Keys erschienen.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-05-31 11:25:10 +02:00
parent 3a7d244433
commit ee60d5fda3
5 changed files with 65 additions and 15 deletions
+13 -6
View File
@@ -1,19 +1,26 @@
import i18n from 'i18next'
import { initReactI18next } from 'react-i18next'
import LanguageDetector from 'i18next-browser-languagedetector'
import enTranslation from './locales/en.json'
import deTranslation from './locales/de.json'
import enJson from './locales/en.json'
import deJson from './locales/de.json'
import { initSeo } from '../utils/seo.js'
/** JSON files wrap strings in `translation` — register that namespace explicitly. */
const resources = {
en: { translation: enJson.translation },
de: { translation: deJson.translation }
}
i18n
.use(LanguageDetector)
.use(initReactI18next)
.init({
resources: {
en: enTranslation,
de: deTranslation
},
resources,
defaultNS: 'translation',
fallbackLng: 'en',
supportedLngs: ['de', 'en'],
nonExplicitSupportedLngs: true,
load: 'languageOnly',
interpolation: {
escapeValue: false // React already escapes values (prevents XSS)
},