feat: improved locale selection (made button, use i18n)
This commit is contained in:
parent
bf4ed43f50
commit
e98a80666f
9 changed files with 291 additions and 44 deletions
20
i18n.ts
Normal file
20
i18n.ts
Normal file
|
@ -0,0 +1,20 @@
|
|||
import i18n from 'i18next';
|
||||
import { initReactI18next } from 'react-i18next';
|
||||
import LanguageDetector from 'i18next-browser-languagedetector';
|
||||
|
||||
i18n
|
||||
.use(LanguageDetector)
|
||||
.use(initReactI18next)
|
||||
.init({
|
||||
resources: {
|
||||
'en-US': {
|
||||
translation: require('./public/locales/en-US.json')
|
||||
}
|
||||
},
|
||||
fallbackLng: 'en-US',
|
||||
interpolation: {
|
||||
escapeValue: false
|
||||
}
|
||||
});
|
||||
|
||||
export default i18n;
|
Loading…
Add table
Add a link
Reference in a new issue