Initial commit
This commit is contained in:
31
resources/js/i18n.ts
Normal file
31
resources/js/i18n.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
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 });
|
||||
Reference in New Issue
Block a user