26 lines
559 B
TypeScript
26 lines
559 B
TypeScript
|
|
import i18n from "i18next";
|
||
|
|
import { initReactI18next } from "react-i18next";
|
||
|
|
import LanguageDetector from "i18next-browser-languagedetector";
|
||
|
|
import HttpBackend from "i18next-http-backend";
|
||
|
|
|
||
|
|
i18n
|
||
|
|
.use(HttpBackend)
|
||
|
|
.use(LanguageDetector)
|
||
|
|
.use(initReactI18next)
|
||
|
|
.init({
|
||
|
|
fallbackLng: "en",
|
||
|
|
ns: ["common", "pages"],
|
||
|
|
defaultNS: "common",
|
||
|
|
backend: {
|
||
|
|
loadPath: "/static/locales/{{lng}}/{{ns}}.json",
|
||
|
|
},
|
||
|
|
interpolation: {
|
||
|
|
escapeValue: false,
|
||
|
|
},
|
||
|
|
react: {
|
||
|
|
useSuspense: false,
|
||
|
|
},
|
||
|
|
});
|
||
|
|
|
||
|
|
export default i18n;
|