trails/packages/i18n/src/index.ts
Ullrich Schäfer cb70a3cce4
Upgrade i18next to v26, fix breaking changes
- i18next 25.10.4 → 26.0.1, react-i18next 16.6.1 → 17.0.1
- Replace removed `initImmediate: false` with `initAsync: false`
- Remove `showSupportNotice` option (removed in v26)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 11:02:22 +02:00

30 lines
745 B
TypeScript

import i18n from "i18next";
import { initReactI18next } from "react-i18next";
import LanguageDetector from "i18next-browser-languagedetector";
import en from "./locales/en.ts";
import de from "./locales/de.ts";
export const defaultNS = "common";
export const resources = {
en: { common: en.common, planner: en.planner, journal: en.journal },
de: { common: de.common, planner: de.planner, journal: de.journal },
} as const;
export function initI18n() {
return i18n
.use(LanguageDetector)
.use(initReactI18next)
.init({
resources,
defaultNS,
fallbackLng: "en",
supportedLngs: ["en", "de"],
interpolation: {
escapeValue: false,
},
initAsync: false,
});
}
export { i18n };