mirror of
https://github.com/Ernous/TorrServerJellyfin.git
synced 2025-12-19 21:46:11 +05:00
simplify i18n
This commit is contained in:
@@ -3,34 +3,32 @@ import ReactDOM from 'react-dom'
|
||||
import { I18nextProvider } from 'react-i18next'
|
||||
import i18n from 'i18next'
|
||||
import LanguageDetector from 'i18next-browser-languagedetector'
|
||||
import XHR from 'i18next-xhr-backend'
|
||||
|
||||
import './index.css'
|
||||
import App from './App'
|
||||
import translationEng from './locales/en/translation.json'
|
||||
import translationRus from './locales/ru/translation.json'
|
||||
|
||||
i18n
|
||||
.use(XHR)
|
||||
.use(LanguageDetector)
|
||||
.init({
|
||||
lng: 'ru', // default
|
||||
fallbackLng: 'en', // use en if detected lng is not available
|
||||
keySeparator: false, // we do not use keys in form messages.welcome
|
||||
interpolation: {
|
||||
escapeValue: false, // react already safes from xss
|
||||
i18n.use(LanguageDetector).init({
|
||||
lng: 'ru', // default
|
||||
fallbackLng: 'en', // use en if detected lng is not available
|
||||
keySeparator: false, // we do not use keys in form messages.welcome
|
||||
interpolation: {
|
||||
escapeValue: false, // react already safes from xss
|
||||
},
|
||||
resources: {
|
||||
en: {
|
||||
// eslint-disable-next-line global-require
|
||||
translations: require('./locales/en/translation.json'),
|
||||
},
|
||||
resources: {
|
||||
en: {
|
||||
translations: translationEng,
|
||||
},
|
||||
ru: {
|
||||
translations: translationRus,
|
||||
},
|
||||
ru: {
|
||||
// eslint-disable-next-line global-require
|
||||
translations: require('./locales/ru/translation.json'),
|
||||
},
|
||||
ns: ['translations'],
|
||||
defaultNS: 'translations',
|
||||
})
|
||||
},
|
||||
ns: ['translations'],
|
||||
defaultNS: 'translations',
|
||||
})
|
||||
|
||||
i18n.languages = ['en', 'ru']
|
||||
|
||||
ReactDOM.render(
|
||||
<StrictMode>
|
||||
|
||||
Reference in New Issue
Block a user