2019-04-16 03:06:39 +03:00
|
|
|
import i18next from 'i18next'
|
2019-05-30 23:42:25 +03:00
|
|
|
import { initReactI18next } from 'react-i18next'
|
2019-04-16 03:06:39 +03:00
|
|
|
import XHR from 'i18next-xhr-backend'
|
2019-04-15 19:56:40 +03:00
|
|
|
import LanguageDetector from 'i18next-browser-languagedetector'
|
2018-12-29 08:36:49 +03:00
|
|
|
|
2019-04-16 03:06:39 +03:00
|
|
|
i18next
|
|
|
|
.use(XHR)
|
2018-12-29 08:36:49 +03:00
|
|
|
.use(LanguageDetector)
|
2019-04-16 03:06:39 +03:00
|
|
|
.use(initReactI18next)
|
2018-12-29 08:36:49 +03:00
|
|
|
.init({
|
2019-04-16 03:06:39 +03:00
|
|
|
backend: {
|
2021-02-16 11:46:17 +03:00
|
|
|
loadPath: `./locales/{{lng}}.json`,
|
2019-04-16 03:06:39 +03:00
|
|
|
},
|
2019-04-25 19:12:47 +03:00
|
|
|
react: {
|
2021-02-16 11:46:17 +03:00
|
|
|
useSuspense: true,
|
2019-04-25 19:12:47 +03:00
|
|
|
},
|
2019-04-15 19:56:40 +03:00
|
|
|
fallbackLng: 'en',
|
2019-05-30 23:42:25 +03:00
|
|
|
preload: ['en'],
|
2018-12-29 08:36:49 +03:00
|
|
|
keySeparator: false,
|
2021-02-16 11:46:17 +03:00
|
|
|
interpolation: { escapeValue: false },
|
2019-04-15 19:56:40 +03:00
|
|
|
})
|
2018-12-29 08:36:49 +03:00
|
|
|
|
2019-04-16 03:06:39 +03:00
|
|
|
export default i18next
|