Files
Termix/src/i18n/i18n.ts
T

59 lines
1.4 KiB
TypeScript
Raw Normal View History

2025-09-12 14:42:00 -05:00
import i18n from "i18next";
import { initReactI18next } from "react-i18next";
import LanguageDetector from "i18next-browser-languagedetector";
import enTranslation from "../locales/en/translation.json";
import zhTranslation from "../locales/zh/translation.json";
2025-10-08 23:55:33 -05:00
import deTranslation from "../locales/de/translation.json";
+7
2025-11-05 10:36:16 -06:00
import ptbrTranslation from "../locales/pt-BR/translation.json";
import ruTranslation from "../locales/ru/translation.json";
2025-11-17 09:46:05 -06:00
import frTranslation from "../locales/fr/translation.json";
2025-09-03 00:14:49 -05:00
i18n
2025-09-12 14:42:00 -05:00
.use(LanguageDetector)
.use(initReactI18next)
2025-09-03 00:14:49 -05:00
.init({
2025-11-17 09:46:05 -06:00
supportedLngs: ["en", "zh", "de", "ptbr", "ru", "fr"],
2025-09-12 14:42:00 -05:00
fallbackLng: "en",
2025-09-03 00:14:49 -05:00
debug: false,
2025-09-12 14:42:00 -05:00
2025-09-03 00:14:49 -05:00
detection: {
2025-09-12 14:42:00 -05:00
order: ["localStorage", "cookie"],
caches: ["localStorage", "cookie"],
lookupLocalStorage: "i18nextLng",
lookupCookie: "i18nextLng",
2025-09-03 00:14:49 -05:00
checkWhitelist: true,
},
2025-09-12 14:42:00 -05:00
resources: {
en: {
translation: enTranslation,
},
zh: {
translation: zhTranslation,
},
2025-10-08 23:55:33 -05:00
de: {
translation: deTranslation,
},
+7
2025-11-05 10:36:16 -06:00
ptbr: {
translation: ptbrTranslation,
},
ru: {
translation: ruTranslation,
},
2025-11-17 09:46:05 -06:00
fr: {
translation: frTranslation,
},
2025-09-03 00:14:49 -05:00
},
2025-09-12 14:42:00 -05:00
2025-09-03 00:14:49 -05:00
interpolation: {
2025-09-12 14:42:00 -05:00
escapeValue: false,
2025-09-03 00:14:49 -05:00
},
2025-09-12 14:42:00 -05:00
2025-09-03 00:14:49 -05:00
react: {
2025-09-12 14:42:00 -05:00
useSuspense: false,
2025-09-03 00:14:49 -05:00
},
});
2025-09-12 14:42:00 -05:00
export default i18n;