2020-08-31 08:41:53 +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';
|
|
|
|
import { initReactI18next } from 'react-i18next';
|
2019-08-03 13:36:29 +09:00
|
|
|
|
2021-11-11 12:37:21 +09:00
|
|
|
const TRANSLATION_VERSION = '6';
|
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-30 23:14:02 +09:00
|
|
|
versions: {
|
|
|
|
en: TRANSLATION_VERSION,
|
2020-08-01 00:08:34 +09:00
|
|
|
de: TRANSLATION_VERSION,
|
2020-08-04 16:06:23 +02:00
|
|
|
fr: TRANSLATION_VERSION,
|
2020-07-30 23:14:02 +09:00
|
|
|
ja: TRANSLATION_VERSION,
|
|
|
|
'zh-Hans': TRANSLATION_VERSION,
|
2020-07-31 11:32:54 +09:00
|
|
|
'zh-Hant': TRANSLATION_VERSION,
|
2020-07-30 23:14:02 +09:00
|
|
|
},
|
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
|
|
|
|
},
|
2020-08-31 08:41:53 +09:00
|
|
|
});
|
2019-08-03 13:36:29 +09:00
|
|
|
|
2020-08-31 08:41:53 +09:00
|
|
|
export default i18n;
|