2019-09-17 14:30:26 +09:00
|
|
|
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';
|
2020-07-29 13:44:03 +09:00
|
|
|
import { initReactI18next } from 'react-i18next';
|
2019-08-03 13:36:29 +09:00
|
|
|
|
2020-07-29 13:44:03 +09:00
|
|
|
const TRANSLATION_VERSION = '1.18';
|
2020-03-06 23:46:19 +09:00
|
|
|
|
2019-08-03 13:36:29 +09:00
|
|
|
i18n
|
|
|
|
.use(Backend)
|
|
|
|
.use(LanguageDetector)
|
|
|
|
.use(initReactI18next)
|
|
|
|
.init({
|
2019-08-08 21:34:06 +09:00
|
|
|
backend: {
|
|
|
|
backends: [LocalStorageBackend, XHR],
|
2019-08-14 15:13:57 +09:00
|
|
|
backendOptions: [
|
|
|
|
{
|
2020-07-29 13:44:03 +09:00
|
|
|
versions: { en: TRANSLATION_VERSION, ja: TRANSLATION_VERSION },
|
2019-08-14 15:13:57 +09:00
|
|
|
},
|
|
|
|
],
|
2019-08-08 21:34:06 +09:00
|
|
|
},
|
2019-08-03 13:36:29 +09:00
|
|
|
fallbackLng: 'en',
|
|
|
|
debug: false,
|
|
|
|
interpolation: {
|
|
|
|
escapeValue: false, // not needed for react as it escapes by default
|
|
|
|
},
|
2019-09-17 14:30:26 +09:00
|
|
|
});
|
2019-08-03 13:36:29 +09:00
|
|
|
|
2019-09-17 14:30:26 +09:00
|
|
|
export default i18n;
|