nestjs-i18n
Advanced tools
Comparing version 8.0.3 to 8.0.4
@@ -1,2 +0,2 @@ | ||
import { I18nService } from './services/i18n.service'; | ||
import { I18nService, translateOptions } from './services/i18n.service'; | ||
export declare class I18nContext { | ||
@@ -6,3 +6,4 @@ readonly detectedLanguage: string; | ||
constructor(detectedLanguage: string, service: I18nService); | ||
translate(key: any, options?: any): Promise<string>; | ||
translate(key: string, options?: translateOptions): Promise<string>; | ||
t(key: string, options?: translateOptions): Promise<string>; | ||
} |
@@ -13,4 +13,7 @@ "use strict"; | ||
} | ||
t(key, options) { | ||
return this.translate(key, options); | ||
} | ||
} | ||
exports.I18nContext = I18nContext; | ||
//# sourceMappingURL=i18n.context.js.map |
@@ -1,2 +0,2 @@ | ||
import { I18nService } from './i18n.service'; | ||
import { I18nService, translateOptions } from './i18n.service'; | ||
export declare class I18nRequestScopeService { | ||
@@ -6,3 +6,4 @@ private readonly req; | ||
constructor(req: any, i18nService: I18nService); | ||
translate(key: any, options?: any): Promise<string>; | ||
translate(key: string, options?: translateOptions): Promise<string>; | ||
t(key: string, options?: translateOptions): Promise<string>; | ||
} |
@@ -29,2 +29,5 @@ "use strict"; | ||
} | ||
t(key, options) { | ||
return this.translate(key, options); | ||
} | ||
}; | ||
@@ -31,0 +34,0 @@ I18nRequestScopeService = __decorate([ |
@@ -6,2 +6,10 @@ import { Logger } from '@nestjs/common'; | ||
import { I18nParser } from '../parsers/i18n.parser'; | ||
export declare type translateOptions = { | ||
lang?: string; | ||
args?: ({ | ||
[k: string]: any; | ||
} | string)[] | { | ||
[k: string]: any; | ||
}; | ||
}; | ||
export declare class I18nService { | ||
@@ -16,12 +24,6 @@ private readonly i18nOptions; | ||
constructor(i18nOptions: I18nOptions, translations: Observable<I18nTranslation>, supportedLanguages: Observable<string[]>, logger: Logger, parser: I18nParser, languagesSubject: BehaviorSubject<string[]>, translationsSubject: BehaviorSubject<I18nTranslation>); | ||
translate(key: string, options?: { | ||
lang?: string; | ||
args?: ({ | ||
[k: string]: any; | ||
} | string)[] | { | ||
[k: string]: any; | ||
}; | ||
}): Promise<string>; | ||
translate(key: string, options?: translateOptions): Promise<string>; | ||
t(key: string, options?: translateOptions): Promise<string>; | ||
getSupportedLanguages(): Promise<string[]>; | ||
refresh(): Promise<void>; | ||
} |
@@ -62,2 +62,5 @@ "use strict"; | ||
} | ||
t(key, options) { | ||
return this.translate(key, options); | ||
} | ||
async getSupportedLanguages() { | ||
@@ -64,0 +67,0 @@ return this.supportedLanguages.pipe(operators_1.take(1)).toPromise(); |
{ | ||
"name": "nestjs-i18n", | ||
"version": "8.0.3", | ||
"version": "8.0.4", | ||
"description": "", | ||
@@ -30,8 +30,8 @@ "author": "Toon van Strijp", | ||
"devDependencies": { | ||
"@nestjs/common": "^7.1.2", | ||
"@nestjs/core": "^7.1.2", | ||
"@nestjs/common": "^7.1.3", | ||
"@nestjs/core": "^7.1.3", | ||
"@nestjs/graphql": "^7.4.1", | ||
"@nestjs/platform-express": "^7.1.2", | ||
"@nestjs/platform-fastify": "^7.1.2", | ||
"@nestjs/testing": "^7.1.2", | ||
"@nestjs/platform-express": "^7.1.3", | ||
"@nestjs/platform-fastify": "^7.1.3", | ||
"@nestjs/testing": "^7.1.3", | ||
"@types/accept-language-parser": "^1.5.1", | ||
@@ -42,4 +42,4 @@ "@types/commander": "^2.12.2", | ||
"@types/jest": "^25.2.3", | ||
"@types/lodash": "^4.14.154", | ||
"@types/node": "^14.0.6", | ||
"@types/lodash": "^4.14.155", | ||
"@types/node": "^14.0.10", | ||
"@types/string-format": "^2.0.0", | ||
@@ -51,6 +51,6 @@ "@types/supertest": "^2.0.9", | ||
"graphql": "^15.0.0", | ||
"graphql-tools": "^6.0.5", | ||
"graphql-tools": "^6.0.7", | ||
"husky": "^4.2.5", | ||
"jest": "^26.0.1", | ||
"lint-staged": "10.2.7", | ||
"lint-staged": "10.2.8", | ||
"prettier": "2.0.5", | ||
@@ -57,0 +57,0 @@ "reflect-metadata": "^0.1.13", |
@@ -1,2 +0,2 @@ | ||
[![Build Status](https://travis-ci.org/ToonvanStrijp/nestjs-i18n.svg?branch=master)](https://travis-ci.org/ToonvanStrijp/nestjs-i18n) [![Greenkeeper badge](https://badges.greenkeeper.io/ToonvanStrijp/nestjs-i18n.svg)](https://greenkeeper.io/) | ||
[![Build Status](https://travis-ci.org/ToonvanStrijp/nestjs-i18n.svg?branch=master)](https://travis-ci.org/ToonvanStrijp/nestjs-i18n) | ||
[![Coverage Status](https://coveralls.io/repos/github/ToonvanStrijp/nestjs-i18n/badge.svg?branch=master)](https://coveralls.io/github/ToonvanStrijp/nestjs-i18n?branch=master) | ||
@@ -26,4 +26,2 @@ | ||
Build in we have a JSON parser (`I18nJsonParser`) this parser handles to following structure | ||
@Column({ default: false }) | ||
activated!: boolean; | ||
@@ -30,0 +28,0 @@ ### Structure |
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 too big to display
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
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
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
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
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
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
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
2288468
2408
379