Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | 5x 5x 5x 10x 36x 36x 12x 12x 5x | import { Inject, Injectable, Scope } from '@nestjs/common'; import { REQUEST } from '@nestjs/core'; import { I18nService } from './i18n.service'; @Injectable({ scope: Scope.REQUEST }) export class I18nRequestScopeService { constructor( @Inject(REQUEST) private readonly req, private readonly i18nService: I18nService, ) {} public translate(key, options?) { options = { lang: this.req.i18nLang, ...options, }; return this.i18nService.translate(key, options); } } |