UNPKG

plot-plan-designer

Version:

Design Editor Tools with React.js + ant.design + fabric.js

56 lines (55 loc) 1.73 kB
"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, // not needed for react!! }, react: { wait: true, // set to true if you like to wait for loaded in every translated hoc nsMode: 'default', // set it to fallback to let passed namespaces to translated hoc act as fallbacks }, 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, }, ms: { 'locale.constant': locales_1.translationMs, }, "pt-BR": { 'locale.constant': locales_1.translationPtBr, }, }, detection: { lookupLocalStorage: 'lang', lookupSessionStorage: 'lang', convertDetectedLanguage: (lng) => { return lng ? lng.split('-')[0] : 'en'; }, }, }); exports.default = i18nClient;