@zextras/carbonio-shell-ui
Version:
The Zextras Carbonio web client
22 lines • 992 B
JavaScript
;
/*
* SPDX-FileCopyrightText: 2024 Zextras <https://www.zextras.com>
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ModuleI18nextProvider = void 0;
const react_1 = __importDefault(require("react"));
const react_i18next_1 = require("react-i18next");
const constants_1 = require("../constants");
const store_1 = require("../store/i18n/store");
const ModuleI18nextProvider = ({ pkg, children }) => {
const { instances, defaultI18n } = store_1.useI18nStore.getState();
const i18n = instances[pkg] ?? instances[constants_1.SHELL_APP_ID] ?? defaultI18n;
return react_1.default.createElement(react_i18next_1.I18nextProvider, { i18n: i18n }, children);
};
exports.ModuleI18nextProvider = ModuleI18nextProvider;
//# sourceMappingURL=module-i18next-provider.js.map