Files
ai-rpg/frontend/src/i18n/index.ts

28 lines
770 B
TypeScript
Raw Normal View History

2026-06-19 11:28:04 +03:00
import i18n from "i18next";
import { initReactI18next } from "react-i18next";
import LanguageDetector from "i18next-browser-languagedetector";
import { ru } from "./ru";
import { en } from "./en";
i18n
.use(LanguageDetector)
.use(initReactI18next)
.init({
resources: {
ru: { translation: ru },
en: { translation: en },
},
2026-06-19 16:31:45 +03:00
// English is the default. The user can switch via the language picker
// in the navbar; the choice is cached in localStorage and overrides
// browser settings on subsequent visits.
fallbackLng: "en",
supportedLngs: ["en", "ru"],
2026-06-19 11:28:04 +03:00
interpolation: { escapeValue: false },
detection: {
order: ["localStorage", "navigator"],
caches: ["localStorage"],
},
});
export default i18n;