@softkit/i18n
Version:
This library is a simple wrapper based on [nestjs-i18n](https://nestjs-i18n.com/)
18 lines • 766 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.I18n = void 0;
const common_1 = require("@nestjs/common");
const i18n_error_1 = require("../i18n.error");
const i18n_context_1 = require("../i18n.context");
const i18n_module_1 = require("../i18n.module");
exports.I18n = (0, common_1.createParamDecorator)((_, context) => {
const i18n = i18n_context_1.I18nContext.current(context);
if (i18n == undefined) {
if (!i18n) {
i18n_module_1.logger.error('I18n context not found! Is this function triggered by a processor or cronjob? Please use the I18nService');
}
throw new i18n_error_1.I18nError('I18n context undefined');
}
return i18n;
});
//# sourceMappingURL=i18n.decorator.js.map