25 lines
579 B
TypeScript
25 lines
579 B
TypeScript
import i18n from 'i18next';
|
|
import { initReactI18next } from 'react-i18next';
|
|
import LanguageDetector from 'i18next-browser-languagedetector';
|
|
import Backend from 'i18next-http-backend';
|
|
|
|
i18n
|
|
.use(LanguageDetector)
|
|
.use(Backend)
|
|
.use(initReactI18next)
|
|
.init({
|
|
fallbackLng: 'en',
|
|
supportedLngs: ['en', 'de', 'es', 'ko'],
|
|
ns: 'common',
|
|
defaultNS: 'common',
|
|
debug: process.env.NODE_ENV !== 'production',
|
|
interpolation: {
|
|
escapeValue: false,
|
|
},
|
|
backend: {
|
|
loadPath: '/i18n/{{lng}}/{{ns}}.json',
|
|
},
|
|
});
|
|
|
|
export default i18n;
|