Skip to content

Commit

Permalink
fix: issue with i18n
Browse files Browse the repository at this point in the history
  • Loading branch information
nmerget committed Oct 5, 2023
1 parent 426bee8 commit b1dab78
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 7 deletions.
19 changes: 18 additions & 1 deletion public/locales/de/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,22 @@
"resetDesc": "Setze alle Werte zurück",
"download": "Herunterladen",
"downloadDesc": "Theme Herunterladen",
"formatCode": "Code formatieren"
"formatCode": "Code formatieren",
"username": "Benutzername",
"password": "Passwort",
"forgotPassword": "Passwort vergessen?",
"keepLogin": "Angemeldet bleiben",
"login": "Anmelden",
"connections": "Verbindungen",
"from": "Von",
"to": " Nach",
"fastestConnection": "Schnellste Verbindungen anzeigen",
"active": "Aktiv",
"today": "Heute",
"options": "Optionen",
"now": "Jetzt",
"later": "Später",
"iceInformation": "Statt ICE 1 verkehrt heute ICE 2. Ihr Fahrschein ist weiterhin gültig.",
"reservationNotPossible": "Sitzplatzreservierung nicht mehr gültig",
"stops": "Haltestellen"
}
13 changes: 7 additions & 6 deletions src/i18n.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import i18n from 'i18next';
import { initReactI18next } from 'react-i18next';
import Backend from 'i18next-http-backend';
import LanguageDetector from 'i18next-browser-languagedetector';
import i18n from "i18next";
import { initReactI18next } from "react-i18next";
import Backend from "i18next-http-backend";
import LanguageDetector from "i18next-browser-languagedetector";

i18n
.use(Backend)
.use(LanguageDetector)
.use(initReactI18next)
.init({
fallbackLng: 'en',
debug: import.meta.env.PRODUCTION === 'PRODUCTION',
fallbackLng: "en",
backend: { loadPath: `/theme-builder/locales/{{lng}}/translation.json` },
debug: import.meta.env.PRODUCTION === "PRODUCTION",
keySeparator: false, // we do not use keys in form messages.welcome
interpolation: {
escapeValue: false, // react already safes from xss
Expand Down

0 comments on commit b1dab78

Please sign in to comment.