From a42e5b2b755c4975a850627c5a4886954435621d Mon Sep 17 00:00:00 2001 From: David Sleeckx Date: Mon, 6 Mar 2017 12:24:01 +0100 Subject: [PATCH] Added language override on service via requestedLanguage --- src/Libs/Vidyano/service.ts | 12 ++++++++++++ src/Libs/Vidyano/vidyano.d.ts | 1 + 2 files changed, 13 insertions(+) diff --git a/src/Libs/Vidyano/service.ts b/src/Libs/Vidyano/service.ts index 49067d13..4c44c6fc 100644 --- a/src/Libs/Vidyano/service.ts +++ b/src/Libs/Vidyano/service.ts @@ -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); @@ -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; } diff --git a/src/Libs/Vidyano/vidyano.d.ts b/src/Libs/Vidyano/vidyano.d.ts index 54e205fa..ace21e51 100644 --- a/src/Libs/Vidyano/vidyano.d.ts +++ b/src/Libs/Vidyano/vidyano.d.ts @@ -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[];