plot-plan-designer
Version:
Design Editor Tools with React.js + ant.design + fabric.js
50 lines (49 loc) • 1.38 kB
JavaScript
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const i18next_1 = __importDefault(require("i18next"));
const i18next_browser_languagedetector_1 = __importDefault(require("i18next-browser-languagedetector"));
const locales_1 = require("../locales");
/**
* Client Side Load
*/
const i18nClient = i18next_1.default
// .use(XHR)
.use(i18next_browser_languagedetector_1.default)
.init({
load: 'all',
nonExplicitWhitelist: false,
fallbackLng: 'en',
interpolation: {
escapeValue: false,
},
react: {
wait: true,
nsMode: 'default',
},
defaultNS: 'locale.constant',
resources: {
en: {
'locale.constant': locales_1.translation,
},
ko: {
'locale.constant': locales_1.translationKo,
},
ja: {
'locale.constant': locales_1.translationJa,
},
fr: {
'locale.constant': locales_1.translationFr,
},
},
detection: {
lookupLocalStorage: "lang",
lookupSessionStorage: "lang",
convertDetectedLanguage: (lng) => {
return lng ? lng.split("-")[0] : "en";
},
},
});
exports.default = i18nClient;