1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-05 20:46:14 +01:00
fab-manager/app/frontend/src/javascript/lib/i18n.ts
2021-06-25 11:03:01 +02:00

27 lines
574 B
TypeScript

import i18n from 'i18next';
import ICU from 'i18next-icu';
import HttpApi from 'i18next-http-backend';
import { initReactI18next } from 'react-i18next';
import { IFablab } from '../models/fablab';
declare var Fablab: IFablab;
i18n
.use(ICU)
.use(HttpApi)
.use(initReactI18next)
.init({
lng: Fablab.locale,
fallbackLng: 'en',
ns: ['admin', 'logged', 'public', 'shared'],
defaultNS: 'shared',
backend: {
loadPath: '/api/translations/{{lng}}/app.{{ns}}'
},
interpolation: {
escapeValue: false
}
});
export default i18n;