nestjs-i18n
Advanced tools
Comparing version 9.0.3 to 9.0.4
@@ -6,4 +6,4 @@ import { I18nService, TranslateOptions } from './services/i18n.service'; | ||
constructor(lang: string, service: I18nService); | ||
translate(key: string, options?: TranslateOptions): any; | ||
t(key: string, options?: TranslateOptions): any; | ||
translate<T = any>(key: string, options?: TranslateOptions): T; | ||
t<T = any>(key: string, options?: TranslateOptions): T; | ||
} |
@@ -6,4 +6,4 @@ import { I18nService, TranslateOptions } from './i18n.service'; | ||
constructor(req: any, i18nService: I18nService); | ||
translate(key: string, options?: TranslateOptions): any; | ||
t(key: string, options?: TranslateOptions): any; | ||
translate<T = any>(key: string, options?: TranslateOptions): T; | ||
t<T = any>(key: string, options?: TranslateOptions): T; | ||
} |
@@ -25,4 +25,4 @@ import { Logger } from '@nestjs/common'; | ||
constructor(i18nOptions: I18nOptions, translations: Observable<I18nTranslation>, supportedLanguages: Observable<string[]>, logger: Logger, loader: I18nLoader, languagesSubject: BehaviorSubject<string[]>, translationsSubject: BehaviorSubject<I18nTranslation>); | ||
translate(key: string, options?: TranslateOptions): any; | ||
t(key: string, options?: TranslateOptions): any; | ||
translate<T = any>(key: string, options?: TranslateOptions): T; | ||
t<T = any>(key: string, options?: TranslateOptions): T; | ||
getSupportedLanguages(): string[]; | ||
@@ -29,0 +29,0 @@ refresh(translations?: I18nTranslation | Observable<I18nTranslation>, languages?: string[] | Observable<string[]>): Promise<void>; |
@@ -60,3 +60,3 @@ "use strict"; | ||
} | ||
return translation !== null && translation !== void 0 ? translation : key; | ||
return (translation !== null && translation !== void 0 ? translation : key); | ||
} | ||
@@ -103,3 +103,3 @@ t(key, options) { | ||
const pluralObject = this.getPluralObject(translation); | ||
if (pluralObject && args && args['count']) { | ||
if (pluralObject && args && args['count'] !== undefined) { | ||
const count = Number(args['count']); | ||
@@ -106,0 +106,0 @@ if (count == 0 && !!pluralObject.zero) { |
{ | ||
"name": "nestjs-i18n", | ||
"version": "9.0.3", | ||
"version": "9.0.4", | ||
"homepage": "https://nestjs-i18n.com", | ||
@@ -5,0 +5,0 @@ "description": "The i18n module for Nest.", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
613975