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
|
|
|
|
2022-06-04 17:00:40 +09:00
|
|
|
const TRANSLATION_VERSION = '17';
|
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,
|
2022-01-31 12:07:25 -03:00
|
|
|
'pt-BR': TRANSLATION_VERSION,
|
2022-03-28 16:28:47 +09:00
|
|
|
es: TRANSLATION_VERSION,
|
2022-04-11 18:40:52 +02:00
|
|
|
it: TRANSLATION_VERSION,
|
2022-06-03 23:12:25 +03:00
|
|
|
ru: TRANSLATION_VERSION,
|
2022-05-25 22:14:32 +02:00
|
|
|
nl: TRANSLATION_VERSION,
|
2022-06-04 03:20:24 +07:00
|
|
|
id: 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;
|