2020-11-02 11:07:08 +01:00
|
|
|
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';
|
2020-11-02 11:07:08 +01:00
|
|
|
|
2021-06-25 11:03:01 +02:00
|
|
|
declare var Fablab: IFablab;
|
2020-11-02 11:07:08 +01:00
|
|
|
|
|
|
|
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}}'
|
2020-11-05 17:32:37 +01:00
|
|
|
},
|
|
|
|
interpolation: {
|
|
|
|
escapeValue: false
|
2020-11-02 11:07:08 +01:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
export default i18n;
|