22 lines
555 B
TypeScript
22 lines
555 B
TypeScript
import i18n from 'i18next';
|
|
import { initReactI18next } from 'react-i18next';
|
|
import HttpApi from 'i18next-http-backend';
|
|
import LanguageDetector from 'i18next-browser-languagedetector';
|
|
|
|
i18n
|
|
.use(HttpApi)
|
|
.use(LanguageDetector)
|
|
.use(initReactI18next)
|
|
.init({
|
|
fallbackLng: 'en',
|
|
detection: {
|
|
order: ['localStorage', 'navigator'],
|
|
lookupLocalStorage: 'app_lang_35394',
|
|
caches: ['localStorage'],
|
|
},
|
|
backend: {
|
|
loadPath: '/locales/{{lng}}/{{ns}}.json',
|
|
},
|
|
interpolation: { escapeValue: false },
|
|
});
|