1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-07 22:46:13 +01:00
fab-manager/app/frontend/src/javascript/lib/i18n.ts

27 lines
574 B
TypeScript
Raw Normal View History

import i18n from 'i18next';
import ICU from 'i18next-icu';
import HttpApi from 'i18next-http-backend';
import { initReactI18next } from 'react-i18next';
2021-06-25 11:03:01 +02:00
import { IFablab } from '../models/fablab';
2021-06-25 11:03:01 +02:00
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;