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 | |
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')
-rw-r--r-- | usecaseui-portal/src/app/app.component.html | 18 | ||||
-rw-r--r-- | usecaseui-portal/src/app/app.component.ts | 22 | ||||
-rw-r--r-- | usecaseui-portal/src/app/home/home.component.html | 2 | ||||
-rw-r--r-- | usecaseui-portal/src/app/homes.service.ts | 2 |
4 files changed, 23 insertions, 21 deletions
diff --git a/usecaseui-portal/src/app/app.component.html b/usecaseui-portal/src/app/app.component.html index 22c22dc7..021cf263 100644 --- a/usecaseui-portal/src/app/app.component.html +++ b/usecaseui-portal/src/app/app.component.html @@ -47,7 +47,7 @@ <span title><i class="anticon anticon-home"></i> {{"i18nTextDefine_Services" | translate}} </span> <ul> <li nz-menu-item><a routerLink='services/services-list'> {{"i18nTextDefine_ServicesList" | translate}} </a></li> - <li nz-menu-item><a routerLink='services/onboard-vnf-vm'> {{"i18nTextDefine_Onboard_VNF/VM" | translate}} </a></li> + <li nz-menu-item><a routerLink='services/onboard-vnf-vm'> {{"i18nTextDefine_PackageManagement" | translate}} </a></li> </ul> </li> <!-- <hr> @@ -78,14 +78,14 @@ </li> </ul> - <nz-dropdown [nzTrigger]="'click'" [nzPlacement]="'bottomRight'"> - <button nz-button nz-dropdown><span>{{selectLanguage | translate}}</span> <i class="anticon anticon-down"></i></button> - <ul nz-menu> - <li nz-menu-item (click)="changeLanguage(item)" *ngFor="let item of Language"> - <a>{{item | translate}}</a> - </li> - </ul> - </nz-dropdown> + <!--<nz-dropdown [nzTrigger]="'click'" [nzPlacement]="'bottomRight'">--> + <!--<button nz-button nz-dropdown><span>{{selectLanguage | translate}}</span> <i class="anticon anticon-down"></i></button>--> + <!--<ul nz-menu>--> + <!--<li nz-menu-item (click)="changeLanguage(item)" *ngFor="let item of Language">--> + <!--<a>{{item | translate}}</a>--> + <!--</li>--> + <!--</ul>--> + <!--</nz-dropdown>--> </nz-sider> <nz-layout style="margin-left: 260px; height:100vh; position:relative;"> <router-outlet></router-outlet> 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); + // } } diff --git a/usecaseui-portal/src/app/home/home.component.html b/usecaseui-portal/src/app/home/home.component.html index 6c79ce7b..34954314 100644 --- a/usecaseui-portal/src/app/home/home.component.html +++ b/usecaseui-portal/src/app/home/home.component.html @@ -24,7 +24,7 @@ <p>{{serviceNumber}} {{"services has been created" | translate}}</p> --> <app-pie [initData]="serviceChartInit" [chartData]="serviceChartData"></app-pie> <div> - <h5><span>{{"i18nTextDefine_Total" | translate}}:</span> {{serviceNumber}} <span>{{"i18nTextDefine_cutomers_and" | translate}}</span> {{serviceNumber}} <span>{{"i18nTextDefine_service_intance" | translate}}</span></h5> + <h5><span>{{"i18nTextDefine_Total" | translate}}:</span> {{serviceNumber}} <span>{{"i18nTextDefine_cutomers_and" | translate}}</span> {{serviceNumber}} <span>{{"i18nTextDefine_service_instance" | translate}}</span></h5> </div> <p class="tip"> <a href="#" style="color:#3C4F8C">{{"i18nTextDefine_ViewDetails" | translate}}</a> diff --git a/usecaseui-portal/src/app/homes.service.ts b/usecaseui-portal/src/app/homes.service.ts index 8c0ab162..a556a954 100644 --- a/usecaseui-portal/src/app/homes.service.ts +++ b/usecaseui-portal/src/app/homes.service.ts @@ -31,7 +31,7 @@ export class HomesService { home_servicebarData:this.baseUrl + "", sourceNames: this.baseUrl + "/alarm/getSourceNames", listSortMasters:this.baseUrl+"/listSortMasters", - currentLanguage:this.baseUrl+"/auxapi/languageSetting/user/", + currentLanguage:this.baseUrl+"/ONAPPORTAL/auxapi/languageSetting/user/", } |