use reflow to migrate from flow to typescript

This commit is contained in:
Sebastian Sdorra
2019-10-19 16:38:07 +02:00
parent f7b8050dfa
commit 6e7a08a3bb
495 changed files with 14239 additions and 13766 deletions

View File

@@ -0,0 +1,43 @@
import i18n from 'i18next';
import Backend from 'i18next-fetch-backend';
import LanguageDetector from 'i18next-browser-languagedetector';
import { reactI18nextModule } from 'react-i18next';
import { urls } from '@scm-manager/ui-components';
const loadPath = urls.withContextPath('/locales/{{lng}}/{{ns}}.json');
// TODO load locales for moment
i18n
.use(Backend)
.use(LanguageDetector)
.use(reactI18nextModule)
.init({
fallbackLng: 'en',
// try to load only "en" and not "en_US"
load: 'languageOnly',
// have a common namespace used around the full app
ns: ['commons'],
defaultNS: 'commons',
debug: false,
interpolation: {
escapeValue: false, // not needed for react!!
},
react: {
wait: true,
},
backend: {
loadPath: loadPath,
init: {
credentials: 'same-origin',
},
},
});
export default i18n;