32 lines
666 B
TypeScript
32 lines
666 B
TypeScript
import i18n from 'i18next';
|
|
import { initReactI18next } from 'react-i18next';
|
|
|
|
const htmlLang = document.documentElement.lang || 'en';
|
|
const initialLang = htmlLang.split('-')[0];
|
|
|
|
i18n
|
|
.use(initReactI18next)
|
|
.init({
|
|
lng: initialLang,
|
|
fallbackLng: 'en',
|
|
interpolation: {
|
|
escapeValue: false,
|
|
},
|
|
resources: {
|
|
en: {
|
|
common: await import('./locales/en/common.json'),
|
|
},
|
|
cs: {
|
|
common: await import('./locales/cs/common.json'),
|
|
},
|
|
},
|
|
ns: ['common', 'ruleset'],
|
|
defaultNS: 'common',
|
|
});
|
|
|
|
export default i18n;
|
|
|
|
// mnozne cislo
|
|
//t('qso_count', { count: 1 });
|
|
//t('qso_count', { count: 5 });
|