Skip to content

Commit

Permalink
Merge branch 'HIRANO-Satoshi-patch-2' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
zewa666 committed Mar 6, 2023
2 parents 5888aa6 + 537c8d1 commit 13ca987
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dist/aurelia-i18n.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export declare class I18N {
nf(options?: Intl.NumberFormatOptions, locales?: string | string[]): Intl.NumberFormat;
uf(numberLike: string, locale?: string): number;
df(options?: Intl.DateTimeFormatOptions, locales?: string | string[]): Intl.DateTimeFormat;
tr<TResult extends string | object | Array<string | object> | undefined = string>(key: string | string[], options?: TOptions<object>): TResult;
tr<TResult extends string | object | Array<string | object> | undefined = string>(key: string | string[], options?: TOptions): TResult;
registerGlobalVariable(key: string, value: any): void;
unregisterGlobalVariable(key: string): void;
/**
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aurelia-i18n",
"version": "4.0.3",
"version": "4.0.4",
"description": "A plugin that provides i18n support.",
"keywords": [
"aurelia",
Expand Down
2 changes: 1 addition & 1 deletion src/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export class I18N {
}

// tslint:disable-next-line: max-line-length
public tr<TResult extends string | object | Array<string | object> | undefined = string>(key: string | string[], options?: TOptions<object>) {
public tr<TResult extends string | object | Array<string | object> | undefined = string>(key: string | string[], options?: TOptions) {
let fullOptions = this.globalVars;

if (options !== undefined) {
Expand Down
5 changes: 5 additions & 0 deletions test/unit/i18n.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ describe("testing i18n translations", () => {
expect(sut.i18next.options.fallbackLng).toEqual(["en"]);
});

it("should have proper overload types for tr", () => {
const value = 1;
sut.tr("key", {score: value});
});

it("should map complex object", () => {
const options = {
threshold: {
Expand Down

0 comments on commit 13ca987

Please sign in to comment.