28 lines
770 B
TypeScript
28 lines
770 B
TypeScript
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 },
|
|
},
|
|
// 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"],
|
|
interpolation: { escapeValue: false },
|
|
detection: {
|
|
order: ["localStorage", "navigator"],
|
|
caches: ["localStorage"],
|
|
},
|
|
});
|
|
|
|
export default i18n;
|