UNPKG

@softkit/i18n

Version:

This library is a simple wrapper based on [nestjs-i18n](https://nestjs-i18n.com/)

22 lines 790 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.TestGuard = void 0; const tslib_1 = require("tslib"); const common_1 = require("@nestjs/common"); const __1 = require("../../../../"); let TestGuard = class TestGuard { canActivate(context) { const response = context.switchToHttp().getResponse(); const i18n = __1.I18nContext.current(); response.header('X-Test', // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore i18n.t('test.CURRENT_LANGUAGE', { args: { lang: i18n.lang } })); return true; } }; exports.TestGuard = TestGuard; exports.TestGuard = TestGuard = tslib_1.__decorate([ (0, common_1.Injectable)() ], TestGuard); //# sourceMappingURL=test.guard.js.map