Permalink
Browse files

Merge pull request #49 from webcomputing/feature/i18next-get-object

Changes `getObject` return value
  • Loading branch information...
antoniusostermann committed Jan 31, 2019
2 parents 5a96f24 + ec58027 commit 732618deba0d21fed860eb6224a462fe479e8287
Showing with 2 additions and 2 deletions.
  1. +1 −1 src/components/i18n/public-interfaces.ts
  2. +1 −1 src/components/i18n/translate-helper.ts
@@ -50,7 +50,7 @@ export interface TranslateHelper extends ShortT {
* @param locals Variables to use in reponse
* @return nested structure with translations
*/
getObject(key?: string, locals?: { [name: string]: string | number | object }): Promise<string | string[] | object>;
getObject<T = any>(key?: string, locals?: { [name: string]: string | number | object }): Promise<T>;
}

export interface InterpolationResolver {
@@ -108,7 +108,7 @@ export class TranslateHelper implements TranslateHelperInterface {
return translation.split(arraySplitter);
}

public async getObject(key?: string, locals: { [name: string]: string | number | object } = {}): Promise<string | string[] | object> {
public async getObject(key?: string, locals: { [name: string]: string | number | object } = {}) {
// Set internal assistantjs option for array-returns-sample.plugin
locals[optionsObjectName] = { [optionEnablingArrayReturn]: true };

0 comments on commit 732618d

Please sign in to comment.