mirror of
https://github.com/HSLdevcom/digitransit-ui
synced 2025-10-06 10:03:40 +02:00
23 lines
543 B
JavaScript
23 lines
543 B
JavaScript
import i18n from 'i18next';
|
|
import { initReactI18next } from 'react-i18next';
|
|
|
|
import { i18n as i18nTrafficNow } from '@digitransit-component/digitransit-component-traffic-now-link';
|
|
|
|
i18n.use(initReactI18next).init({
|
|
fallbackLng: 'fi',
|
|
defaultNS: 'translation',
|
|
// debug: true,
|
|
interpolation: {
|
|
escapeValue: false, // not needed for react as it escapes by default
|
|
},
|
|
resources: {},
|
|
react: {
|
|
useSuspense: true,
|
|
},
|
|
});
|
|
|
|
i18n.on('languageChanged', lng => {
|
|
i18nTrafficNow.changeLanguage(lng);
|
|
});
|
|
|
|
export default i18n;
|