Skip to content

Commit

Permalink
Added language override on service via requestedLanguage
Browse files Browse the repository at this point in the history
  • Loading branch information
Sleeckx committed Mar 7, 2017
1 parent 9648a00 commit a42e5b2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Libs/Vidyano/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@
data.authToken = this.authToken;
}

const requestedLanguage = this.requestedLanguage;
if (requestedLanguage != null)
data.requestedLanguage = requestedLanguage;

if (this.application && this.application.session)
data.session = this.application.session.toServiceObject(true);

Expand Down Expand Up @@ -363,6 +367,14 @@
this._language = l;
}

get requestedLanguage(): string {
return Vidyano.cookie("requestedLanguage");
}

set requestedLanguage(val: string) {
Vidyano.cookie("requestedLanguage", val);
}

get isSignedIn(): boolean {
return this._isSignedIn;
}
Expand Down
1 change: 1 addition & 0 deletions src/Libs/Vidyano/vidyano.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -890,6 +890,7 @@ declare namespace Vidyano {
readonly application: Application;
private _setApplication(application);
language: ILanguage;
requestedLanguage: string;
readonly isSignedIn: boolean;
private _setIsSignedIn(val);
readonly languages: ILanguage[];
Expand Down

0 comments on commit a42e5b2

Please sign in to comment.