2019-11-16 20:46:19 +00:00
|
|
|
import i18n from 'i18next';
|
|
|
|
import { initReactI18next } from 'react-i18next';
|
|
|
|
import LocalStorageBackend from 'i18next-localstorage-backend';
|
|
|
|
import XHR from 'i18next-xhr-backend';
|
|
|
|
import Backend from 'i18next-chained-backend';
|
|
|
|
|
|
|
|
i18n
|
|
|
|
.use(Backend)
|
|
|
|
.use(initReactI18next)
|
|
|
|
.init({
|
2022-02-26 17:01:05 +00:00
|
|
|
debug: process.env.I18N_DEBUG === 'true',
|
2019-11-16 20:46:19 +00:00
|
|
|
lng: 'en',
|
|
|
|
fallbackLng: 'en',
|
|
|
|
keySeparator: '.',
|
|
|
|
backend: {
|
|
|
|
backends: [
|
|
|
|
LocalStorageBackend,
|
|
|
|
XHR,
|
|
|
|
],
|
2020-07-05 01:30:50 +00:00
|
|
|
backendOptions: [ {
|
2019-11-16 20:46:19 +00:00
|
|
|
prefix: 'pterodactyl_lng__',
|
|
|
|
expirationTime: 7 * 24 * 60 * 60 * 1000, // 7 days, in milliseconds
|
|
|
|
store: window.localStorage,
|
|
|
|
}, {
|
|
|
|
loadPath: '/locales/{{lng}}/{{ns}}.json',
|
2020-07-05 01:30:50 +00:00
|
|
|
} ],
|
2019-11-16 20:46:19 +00:00
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
// i18n.loadNamespaces(['validation']);
|
|
|
|
|
|
|
|
export default i18n;
|