uniswap-interface-uncensored/src/i18n.js

27 lines
761 B
JavaScript
Raw Normal View History

import i18next from 'i18next'
import XHR from 'i18next-xhr-backend'
import LanguageDetector from 'i18next-browser-languagedetector'
import { initReactI18next } from 'react-i18next'
2018-12-29 08:36:49 +03:00
i18next
2018-12-29 08:36:49 +03:00
// load translation using xhr -> see /public/locales
// https://github.com/i18next/i18next-xhr-backend
.use(XHR)
2018-12-29 08:36:49 +03:00
// detect user language
// https://github.com/i18next/i18next-browser-languageDetector
2018-12-29 08:36:49 +03:00
.use(LanguageDetector)
.use(initReactI18next)
// https://www.i18next.com/overview/configuration-options
2018-12-29 08:36:49 +03:00
.init({
backend: {
loadPath: './locales/{{lng}}.json'
},
fallbackLng: 'en',
2018-12-29 08:36:49 +03:00
keySeparator: false,
interpolation: {
escapeValue: false // not needed for react as it escapes by default
2018-12-29 08:36:49 +03:00
}
})
2018-12-29 08:36:49 +03:00
export default i18next