@zextras/carbonio-shell-ui
Version:
The Zextras Carbonio web client
21 lines • 850 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getT = exports.getTFunction = exports.getI18n = void 0;
const store_1 = require("./store");
const constants_1 = require("../../constants");
const getI18n = (app) => () => {
const { instances, defaultI18n } = store_1.useI18nStore.getState();
return instances[app] ?? instances[constants_1.SHELL_APP_ID] ?? defaultI18n;
};
exports.getI18n = getI18n;
const getTFunction = (app) => {
const { instances, defaultI18n } = store_1.useI18nStore.getState();
return instances[app]?.t ?? defaultI18n.t;
};
exports.getTFunction = getTFunction;
const getT = () => {
const { instances, defaultI18n } = store_1.useI18nStore.getState();
return instances[constants_1.SHELL_APP_ID]?.t ?? defaultI18n.t;
};
exports.getT = getT;
//# sourceMappingURL=hooks.js.map