diff options
author | guochuyicmri <guochuyi@chinamobile.com> | 2019-05-08 16:14:41 +0800 |
---|---|---|
committer | guochuyicmri <guochuyi@chinamobile.com> | 2019-05-08 16:14:45 +0800 |
commit | 9173c17032ab2bb7c2a5f82d67c3d1ef94849471 (patch) | |
tree | 373d05e92e46118c53d2fd9937c795706ca31a32 /usecaseui-portal/src/app/app.component.ts | |
parent | ad5450efb78c3140cae0a56c29c8a2506cd41a0f (diff) |
UUI interface Multi-language development
Change-Id: I14cac372a76127f33f85e2bb50be117dbcdabe7d
Issue-ID: USECASEUI-211
Signed-off-by: guochuyicmri <guochuyi@chinamobile.com>
Diffstat (limited to 'usecaseui-portal/src/app/app.component.ts')
-rw-r--r-- | usecaseui-portal/src/app/app.component.ts | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/usecaseui-portal/src/app/app.component.ts b/usecaseui-portal/src/app/app.component.ts index 1a7c48d8..dc8b03e9 100644 --- a/usecaseui-portal/src/app/app.component.ts +++ b/usecaseui-portal/src/app/app.component.ts @@ -28,22 +28,24 @@ export class AppComponent { constructor(private translate: TranslateService,private myhttp: HomesService) { this.currentLanguageGet(); - translate.addLangs(['en', 'zh']); + // translate.addLangs(['en', 'zh']); // translate.use('en'); } - Language:String[] = ["zh","en"]; + // Language:String[] = ["zh","en"]; //209.05.08 Get the currentLanguage currentloginId = null; currentLanguage = "en"; currentLanguageGet() { this.currentloginId = sessionStorage.getItem("loginId") || null; if (this.currentloginId != null) { + console.log(this.currentloginId); this.myhttp.getCurrentLanguage(this.currentloginId) .subscribe( (data) => { - this.currentLanguage = data.languageName.toLowerCase(); + console.log(data,"-------------getCurrentLanguage"); + this.currentLanguage = data.languageAlias.toLowerCase(); this.translate.use(this.currentLanguage); }, (err) => { @@ -51,14 +53,14 @@ export class AppComponent { } ) }else { - this.translate.setDefaultLang('en'); + this.translate.setDefaultLang(this.currentLanguage); } } + // + // selectLanguage = "en"; - selectLanguage = "en"; - - changeLanguage(item){ - this.selectLanguage = item; - this.translate.use(item); - } + // changeLanguage(item){ + // this.selectLanguage = item; + // this.translate.use(item); + // } } |