From aaa447bd7e4b4dbfc75e6ea6c393a86c6d567bdc Mon Sep 17 00:00:00 2001 From: "Watal M. Iwasaki" Date: Fri, 17 Jul 2015 00:51:16 +0900 Subject: [PATCH 1/2] i18next: Add init() and setLng() with a two-arg callback --- i18next/i18next.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/i18next/i18next.d.ts b/i18next/i18next.d.ts index 3d24c9b96..e20cb4c93 100644 --- a/i18next/i18next.d.ts +++ b/i18next/i18next.d.ts @@ -87,6 +87,7 @@ interface I18nextStatic { }; init(callback?: (t: (key: string, options?: any) => string) => void ): JQueryDeferred; init(options?: I18nextOptions, callback?: (t: (key: string, options?: any) => string) => void ): JQueryDeferred; + init(options?: I18nextOptions, callback?: (err: any, t: (key: string, options?: any) => string) => void ): JQueryDeferred; lng(): string; loadNamespace(namespace: string, callback?: () => void ): void; loadNamespaces(namespaces: string[], callback?: () => void ): void; @@ -104,6 +105,7 @@ interface I18nextStatic { preload(languages: string[], callback?: (t: (key: string, options?: any) => string) => void ): void; setDefaultNamespace(namespace: string): void; setLng(language: string, callback?: (t: (key: string, options?: any) => string) => void ): void; + setLng(language: string, callback?: (err: any, t: (key: string, options?: any) => string) => void ): void; sync: { load: (languages: string[], options: I18nextOptions, callback: (err: Error, store: IResourceStore) => void ) => void; postMissing: (language: string, namespace: string, key: string, defaultValue: any, languages: string[]) => void; From 0bae9f2cb769947045340f4a3c6ba9a370365b7b Mon Sep 17 00:00:00 2001 From: "Watal M. Iwasaki" Date: Sun, 19 Jul 2015 22:24:02 +0900 Subject: [PATCH 2/2] i18next: Modify 'callback' to take two arguments. --- i18next/i18next.d.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/i18next/i18next.d.ts b/i18next/i18next.d.ts index e20cb4c93..060335af0 100644 --- a/i18next/i18next.d.ts +++ b/i18next/i18next.d.ts @@ -85,8 +85,7 @@ interface I18nextStatic { toLanguages(language: string): string[]; regexEscape(str: string): string; }; - init(callback?: (t: (key: string, options?: any) => string) => void ): JQueryDeferred; - init(options?: I18nextOptions, callback?: (t: (key: string, options?: any) => string) => void ): JQueryDeferred; + init(callback?: (err: any, t: (key: string, options?: any) => string) => void ): JQueryDeferred; init(options?: I18nextOptions, callback?: (err: any, t: (key: string, options?: any) => string) => void ): JQueryDeferred; lng(): string; loadNamespace(namespace: string, callback?: () => void ): void; @@ -101,10 +100,9 @@ interface I18nextStatic { rules: any; setCurrentLng: (language: string) => void; }; - preload(language: string, callback?: (t: (key: string, options?: any) => string) => void ): void; - preload(languages: string[], callback?: (t: (key: string, options?: any) => string) => void ): void; + preload(language: string, callback?: (err: any, t: (key: string, options?: any) => string) => void ): void; + preload(languages: string[], callback?: (err: any, t: (key: string, options?: any) => string) => void ): void; setDefaultNamespace(namespace: string): void; - setLng(language: string, callback?: (t: (key: string, options?: any) => string) => void ): void; setLng(language: string, callback?: (err: any, t: (key: string, options?: any) => string) => void ): void; sync: { load: (languages: string[], options: I18nextOptions, callback: (err: Error, store: IResourceStore) => void ) => void;