1
0
mirror of https://github.com/uetchy/namae.git synced 2025-08-20 18:08:11 +09:00

chore: move i18n to util

This commit is contained in:
2019-08-27 14:33:32 +09:00
parent 20110231c2
commit 6fbd0346d0
2 changed files with 1 additions and 1 deletions

28
web/src/util/i18n.js Normal file
View File

@@ -0,0 +1,28 @@
import i18n from 'i18next'
import Backend from 'i18next-chained-backend'
import LocalStorageBackend from 'i18next-localstorage-backend'
import XHR from 'i18next-xhr-backend'
import LanguageDetector from 'i18next-browser-languagedetector'
import { initReactI18next } from 'react-i18next'
i18n
.use(Backend)
.use(LanguageDetector)
.use(initReactI18next)
.init({
backend: {
backends: [LocalStorageBackend, XHR],
backendOptions: [
{
versions: { en: '1.3', ja: '1.3' },
},
],
},
fallbackLng: 'en',
debug: false,
interpolation: {
escapeValue: false, // not needed for react as it escapes by default
},
})
export default i18n