diff --git a/src/portal/src/app/dev-center/dev-center.component.ts b/src/portal/src/app/dev-center/dev-center.component.ts index 504a763cd..46a60af71 100644 --- a/src/portal/src/app/dev-center/dev-center.component.ts +++ b/src/portal/src/app/dev-center/dev-center.component.ts @@ -2,19 +2,37 @@ import { AfterViewInit, Component, ElementRef, OnInit } from '@angular/core'; import { Http } from '@angular/http'; import { throwError as observableThrowError, Observable } from 'rxjs'; import { catchError, map } from 'rxjs/operators'; +import { Title } from '@angular/platform-browser'; +import { TranslateService } from '@ngx-translate/core'; const SwaggerUI = require('swagger-ui'); @Component({ selector: 'dev-center', templateUrl: 'dev-center.component.html', + viewProviders: [Title], styleUrls: ['dev-center.component.scss'] }) -export class DevCenterComponent implements AfterViewInit { +export class DevCenterComponent implements AfterViewInit, OnInit { private ui: any; private host: any; private json: any; - constructor(private el: ElementRef, private http: Http) { + constructor( + private el: ElementRef, + private http: Http, + private translate: TranslateService, + private titleService: Title) { + } + + ngOnInit() { + this.setTitle("APP_TITLE.HARBOR_SWAGGER"); + } + + + public setTitle( key: string) { + this.translate.get(key).subscribe((res: string) => { + this.titleService.setTitle(res); + }); } ngAfterViewInit() { diff --git a/src/portal/src/i18n/lang/en-us-lang.json b/src/portal/src/i18n/lang/en-us-lang.json index ab30ea7ac..9f27b835d 100644 --- a/src/portal/src/i18n/lang/en-us-lang.json +++ b/src/portal/src/i18n/lang/en-us-lang.json @@ -4,7 +4,8 @@ "HARBOR": "Harbor", "VIC": "vSphere Integrated Containers", "MGMT": "Management", - "REG": "Registry" + "REG": "Registry", + "HARBOR_SWAGGER": "Harbor Swagger" }, "SIGN_IN": { "REMEMBER": "Remember me", diff --git a/src/portal/src/i18n/lang/es-es-lang.json b/src/portal/src/i18n/lang/es-es-lang.json index fc49cc392..d2bf70044 100644 --- a/src/portal/src/i18n/lang/es-es-lang.json +++ b/src/portal/src/i18n/lang/es-es-lang.json @@ -4,7 +4,8 @@ "HARBOR": "Harbor", "VIC": "Contenedores Integrados vSphere", "MGMT": "Administración", - "REG": "Registro" + "REG": "Registro", + "HARBOR_SWAGGER": "Harbor Swagger" }, "SIGN_IN": { "REMEMBER": "Recordarme", diff --git a/src/portal/src/i18n/lang/fr-fr-lang.json b/src/portal/src/i18n/lang/fr-fr-lang.json index 97dc82719..501e6bce7 100644 --- a/src/portal/src/i18n/lang/fr-fr-lang.json +++ b/src/portal/src/i18n/lang/fr-fr-lang.json @@ -4,7 +4,8 @@ "HARBOR": "Harbor", "VIC": "vSphere Integrated Containers", "MGMT": "Management", - "REG": "Registre" + "REG": "Registre", + "HARBOR_SWAGGER": "Harbor Swagger" }, "SIGN_IN": { "REMEMBER": "Se souvenir de moi", diff --git a/src/portal/src/i18n/lang/pt-br-lang.json b/src/portal/src/i18n/lang/pt-br-lang.json index a803e4ac8..a46fc5415 100644 --- a/src/portal/src/i18n/lang/pt-br-lang.json +++ b/src/portal/src/i18n/lang/pt-br-lang.json @@ -4,7 +4,8 @@ "HARBOR": "Harbor", "VIC": "vSphere Integrated Containers", "MGMT": "Gerência", - "REG": "Registro" + "REG": "Registro", + "HARBOR_SWAGGER": "Harbor Swagger" }, "SIGN_IN": { "REMEMBER": "Lembrar-se de mim", diff --git a/src/portal/src/i18n/lang/zh-cn-lang.json b/src/portal/src/i18n/lang/zh-cn-lang.json index 47df87120..87de7890a 100644 --- a/src/portal/src/i18n/lang/zh-cn-lang.json +++ b/src/portal/src/i18n/lang/zh-cn-lang.json @@ -4,7 +4,8 @@ "HARBOR": "Harbor", "VIC": "vSphere Integrated Containers", "MGMT": "Management", - "REG": "Registry" + "REG": "Registry", + "HARBOR_SWAGGER": "Harbor Swagger" }, "SIGN_IN": { "REMEMBER": "记住我",