express-react-boilerplate
Version:
Express react boilerplate
24 lines (21 loc) • 519 B
JavaScript
import i18next from 'i18next';
import Backend from 'i18next-xhr-backend';
import LanguageDetector from 'i18next-browser-languagedetector';
import { initReactI18next } from 'react-i18next';
i18next
.use(LanguageDetector)
.use(Backend)
.use(initReactI18next)
.init({
ns: ['common'],
defaultNS: 'common',
fallbackLng: ['en'],
debug: __DEV__,
interpolation: {
escapeValue: false,
},
backend: {
loadPath: '/locales/{{lng}}/{{ns}}.json',
},
});
export default i18next;