summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorguochuyicmri <guochuyi@chinamobile.com>2019-05-08 10:55:37 +0800
committerguochuyicmri <guochuyi@chinamobile.com>2019-05-08 10:55:46 +0800
commitd55e3b044987f29f03de2816e2cd8015c54c9db3 (patch)
tree5fe2b92222483983d58b2edf892e2b60d5cbde3f
parentbf240f4fad6e8bf032bd1f190b238682a9fb721a (diff)
UUI interface Multi-language development
Change-Id: I687222a6342e57bb81651ac210a8862f1980b051 Issue-ID: USECASEUI-211 Signed-off-by: guochuyicmri <guochuyi@chinamobile.com>
-rw-r--r--usecaseui-portal/src/app/app.component.html36
-rw-r--r--usecaseui-portal/src/app/app.component.ts40
-rw-r--r--usecaseui-portal/src/app/homes.service.ts6
-rw-r--r--usecaseui-portal/src/assets/i18n/en.json130
-rw-r--r--usecaseui-portal/src/assets/i18n/zh.json132
5 files changed, 300 insertions, 44 deletions
diff --git a/usecaseui-portal/src/app/app.component.html b/usecaseui-portal/src/app/app.component.html
index 25d8f6d6..22c22dc7 100644
--- a/usecaseui-portal/src/app/app.component.html
+++ b/usecaseui-portal/src/app/app.component.html
@@ -20,16 +20,34 @@
<a routerLink="home">
<span title>
<i class="anticon anticon-home"></i>
- <span> {{"Home" | translate}} </span>
+ <span> {{"i18nTextDefine_Home" | translate}} </span>
+ </span>
+ </a>
+ </li>
+ <hr>
+ <li nz-menu-item>
+ <a routerLink="management">
+ <span title>
+ <i class="anticon anticon-user"></i>
+ <span> {{"i18nTextDefine_Customer" | translate}} </span>
+ </span>
+ </a>
+ </li>
+ <hr>
+ <li nz-menu-item>
+ <a routerLink="fcaps">
+ <span title>
+ <i class="anticon anticon-user"></i>
+ <span> {{"i18nTextDefine_Monitor" | translate}} </span>
</span>
</a>
</li>
<hr>
<li nz-submenu>
- <span title><i class="anticon anticon-home"></i> {{"Services" | translate}} </span>
+ <span title><i class="anticon anticon-home"></i> {{"i18nTextDefine_Services" | translate}} </span>
<ul>
- <li nz-menu-item><a routerLink='services/services-list'> {{"Services List" | translate}}</a></li>
- <li nz-menu-item><a routerLink='services/onboard-vnf-vm'> Onboard VNF/VM </a></li>
+ <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>
</ul>
</li>
<!-- <hr>
@@ -37,16 +55,16 @@
<a routerLink="alarm">
<span title>
<i class="anticon anticon-mail"></i>
- <span> {{"Alarm" | translate}} </span>
+ <span> {{"i18nTextDefine_Alarm" | translate}} </span>
</span>
</a>
</li>
<hr> -->
<!-- <li nz-submenu>
- <span title><i class="anticon anticon-setting"></i> {{"Monitor" | translate}} </span>
+ <span title><i class="anticon anticon-setting"></i> {{"i18nTextDefine_Monitor" | translate}} </span>
<ul>
- <li nz-menu-item><a routerLink='alarm'> {{"Alarm" | translate}} </a></li>
- <li nz-menu-item><a routerLink='performance/performance-vnf'> {{"Performance" | translate}}</a></li>
+ <li nz-menu-item><a routerLink='alarm'> {{"i18nTextDefine_Alarm" | translate}} </a></li>
+ <li nz-menu-item><a routerLink='performance/performance-vnf'> {{"i18nTextDefine_Performance" | translate}}</a></li>
</ul>
</li> -->
<hr>
@@ -54,7 +72,7 @@
<a routerLink="network">
<span title>
<i class="anticon anticon-share-alt"></i>
- <span> {{"Network" | translate}} </span>
+ <span> {{"i18nTextDefine_NetworkTopology" | translate}} </span>
</span>
</a>
</li>
diff --git a/usecaseui-portal/src/app/app.component.ts b/usecaseui-portal/src/app/app.component.ts
index 0bdf72b2..1a7c48d8 100644
--- a/usecaseui-portal/src/app/app.component.ts
+++ b/usecaseui-portal/src/app/app.component.ts
@@ -13,8 +13,10 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
-import { Component } from '@angular/core';
-import { TranslateService } from '@ngx-translate/core';
+import {Component} from '@angular/core';
+import {TranslateService} from '@ngx-translate/core';
+import {MyhttpService} from "./myhttp.service";
+import {HomesService} from "./homes.service";
@Component({
@@ -23,15 +25,37 @@ import { TranslateService } from '@ngx-translate/core';
styleUrls: ['./app.component.less']
})
export class AppComponent {
- constructor(private translate:TranslateService){
- translate.addLangs(['en', 'zh']);
- translate.setDefaultLang('en');
- // translate.use('en');
- }
+
+ constructor(private translate: TranslateService,private myhttp: HomesService) {
+ this.currentLanguageGet();
+ translate.addLangs(['en', 'zh']);
+ // translate.use('en');
+ }
Language:String[] = ["zh","en"];
- selectLanguage = "en";
+ //209.05.08 Get the currentLanguage
+ currentloginId = null;
+ currentLanguage = "en";
+ currentLanguageGet() {
+ this.currentloginId = sessionStorage.getItem("loginId") || null;
+ if (this.currentloginId != null) {
+ this.myhttp.getCurrentLanguage(this.currentloginId)
+ .subscribe(
+ (data) => {
+ this.currentLanguage = data.languageName.toLowerCase();
+ this.translate.use(this.currentLanguage);
+ },
+ (err) => {
+ console.log(err);
+ }
+ )
+ }else {
+ this.translate.setDefaultLang('en');
+ }
+ }
+
+ selectLanguage = "en";
changeLanguage(item){
this.selectLanguage = item;
diff --git a/usecaseui-portal/src/app/homes.service.ts b/usecaseui-portal/src/app/homes.service.ts
index 254408dd..8c0ab162 100644
--- a/usecaseui-portal/src/app/homes.service.ts
+++ b/usecaseui-portal/src/app/homes.service.ts
@@ -31,6 +31,7 @@ export class HomesService {
home_servicebarData:this.baseUrl + "",
sourceNames: this.baseUrl + "/alarm/getSourceNames",
listSortMasters:this.baseUrl+"/listSortMasters",
+ currentLanguage:this.baseUrl+"/auxapi/languageSetting/user/",
}
@@ -110,4 +111,9 @@ export class HomesService {
getListSortMasters(){
return this.http.get<any>(this.url.listSortMasters);
}
+ //2019.05.08 add
+ getCurrentLanguage(currentloginId){
+ let url=this.url.currentLanguage+currentloginId;
+ return this.http.get<any>(url);
+ }
}
diff --git a/usecaseui-portal/src/assets/i18n/en.json b/usecaseui-portal/src/assets/i18n/en.json
index 9b191f8e..f45e5e32 100644
--- a/usecaseui-portal/src/assets/i18n/en.json
+++ b/usecaseui-portal/src/assets/i18n/en.json
@@ -4,19 +4,123 @@
"en":"English",
"app-component":"--:",
- "Home":"Home",
- "Services":"Services",
- "Services List":"Services List",
- "Alarm":"Alarm",
- "Performance":"Performance",
- "Monitor":"Monitor",
- "Network":"Network",
+ "i18nTextDefine_Home":"Home",
+ "i18nTextDefine_Customer":"Customer",
+ "i18nTextDefine_Monitor":"Monitor",
+ "i18nTextDefine_Services":"Services",
+ "i18nTextDefine_ServicesList":"Services List",
+ "i18nTextDefine_Onboard_VNF/VM":"Onboard VNF/VM ",
+ "i18nTextDefine_Alarm":"Alarm",
+ "i18nTextDefine_Performance":"Performance",
+ "i18nTextDefine_NetworkTopology":"Network Topology",
"home-component":"--:",
- "Overall trend":"Overall trend",
- "SERVICES":"SERVICES",
- "services":"services",
- "services has been created":"services has been created",
- "PERFORMANCE":"PERFORMANCE",
- "VM Performance":"VM Performance"
+ "i18nTextDefine_SERVICES":"SERVICES",
+ "i18nTextDefine_PACKAGE":"PACKAGE",
+ "i18nTextDefine_Total":"Total",
+ "i18nTextDefine_cutomers_and":"cutomers and",
+ "i18nTextDefine_service_intance":"service intance",
+ "i18nTextDefine_ViewDetails":"View Details",
+ "i18nTextDefine_ALARM":"ALARM",
+ "i18nTextDefine_DEVICES":"DEVICES",
+ "i18nTextDefine_VNF_Alarm":"VNF Alarm",
+ "i18nTextDefine_VM_Alarm":"VM Alarm",
+ "i18nTextDefine_VM_Performance":"VM PERFORMANCE",
+
+ "services-list-component":"--:",
+ "i18nTextDefine_ServiceType":"Service Type",
+ "i18nTextDefine_Create":"Create",
+ "i18nTextDefine_Failed":"Failed",
+ "i18nTextDefine_Success":"Success",
+ "i18nTextDefine_InProgress":"In Progress",
+ "i18nTextDefine_End_To_End_Service":"End To End Service",
+ "i18nTextDefine_Network_Service":"Network Service",
+ "i18nTextDefine_Cross_Domain_and_Cross_Layer_VPN":"Cross Domain and Cross Layer VPN",
+ "i18nTextDefine_NO":"NO",
+ "i18nTextDefine_Name":"Name",
+ "i18nTextDefine_Description":"Description",
+ "i18nTextDefine_UseCase":"Use Case",
+ "i18nTextDefine_Status":"Status",
+ "i18nTextDefine_Action":"Action",
+ "i18nTextDefine_Template":"Template",
+ "i18nTextDefine_ServiceCreation":"Service Creation",
+ "i18nTextDefine_Cancel":"Cancel",
+ "i18nTextDefine_modelOk":"OK",
+ "i18nTextDefine_Scale":"Scale",
+ "i18nTextDefine_SureScale":"Are you sure scale this instance?",
+ "i18nTextDefine_InstanceName":"Instance Name",
+ "i18nTextDefine_InstanceID":"Instance ID",
+ "i18nTextDefine_ScaleType":"Scale Type",
+ "i18nTextDefine_AspectId":"AspectId",
+ "i18nTextDefine_Number_Of_Steps":"Number Of Steps",
+ "i18nTextDefine_ScalingDirection":"Scaling Direction",
+ "i18nTextDefine_delete":"Delete",
+ "i18nTextDefine_SureDelete":"Are you sure delete this instance?",
+ "i18nTextDefine_terminationType":"terminationType",
+ "i18nTextDefine_graceful":"graceful",
+ "i18nTextDefine_forceful":"forceful",
+ "i18nTextDefine_gracefulTerminationTimeout":"gracefulTerminationTimeout",
+ "i18nTextDefine_Heal":"Heal",
+ "i18nTextDefine_SureHeal":"Are you sure heal this instance?",
+ "i18nTextDefine_degreeHealing":"degreeHealing",
+ "i18nTextDefine_healScript":"healScript",
+ "i18nTextDefine_additionalParamsforNs":"additionalParamsforNs",
+ "i18nTextDefine_cause":"cause",
+ "i18nTextDefine_action":"action",
+ "i18nTextDefine_actionvminfo":"actionvminfo",
+
+ "ccvpn-creation-component":"--:",
+ "i18nTextDefine_InstanceCreation":"Instance Creation",
+ "i18nTextDefine_InstanceTopology":"Instance Topology",
+ "i18nTextDefine_Add":"Add",
+ "i18nTextDefine_topology":"topology",
+ "i18nTextDefine_PostCode":"Post Code",
+ "i18nTextDefine_Address":"Address",
+ "i18nTextDefine_emails":"emails",
+ "i18nTextDefine_Base":"Base",
+ "i18nTextDefine_templateInputs":"template Inputs",
+
+ "ccvpn-detail-component":"--:",
+ "i18nTextDefine_InstanceDetail":"Instance Detail",
+
+ "onboard-vnf-vm-component":"--:",
+ "i18nTextDefine_Click_CSAR_File":"Click or drag CSAR File here",
+ "i18nTextDefine_Uploaded_files":"Uploaded files",
+ "i18nTextDefine_Uploading":"Uploading",
+ "i18nTextDefine_StartUpload":"StartUpload",
+ "i18nTextDefine_File_upload_completed":"File upload completed",
+ "i18nTextDefine_Version":"Version",
+ "i18nTextDefine_OnboardingState":"Onboarding State",
+ "i18nTextDefine_OperationalState":"Operational State",
+ "i18nTextDefine_UsageState":"Usage State",
+ "i18nTextDefine_Operationbutton":"Operation button",
+
+ "management-component":"--:",
+ "i18nTextDefine_Create_initial_customer":"Create initial customer",
+ "i18nTextDefine_Customer_not_in_ONAP":"Customer has not been created in ONAP",
+ "i18nTextDefine_createCustomer&serviceType":"please create customer and its service type",
+ "i18nTextDefine_input_customerName":"input customer name",
+
+ "customer-component":"--:",
+ "i18nTextDefine_Instance_Count_of_Customer":"Instance Count of Customer",
+ "i18nTextDefine_users":"users",
+ "i18nTextDefine_Instance_Count_of_ServiceType":"Instance Count of Service Type",
+ "i18nTextDefine_Input_ServicesType":"Input services type",
+ "i18nTextDefine_Input_Sure_deleteCustomer":"Are you sure delete this Customer ?",
+ "i18nTextDefine_Input_Sure_deleteServiceType":"Are you sure delete this Service Type ?",
+ "i18nTextDefine_CustomerName":"Customer Name",
+ "i18nTextDefine_CustomerID":"Customer ID",
+
+ "ccvpn-network-component":"--:",
+ "i18nTextDefine_AddLink":"Add Link",
+ "i18nTextDefine_SetAttribtes":"Set Attribtes",
+ "i18nTextDefine_LinkName":"Link Name ",
+ "i18nTextDefine_LeftPort":"Left Port",
+ "i18nTextDefine_Network":"Network",
+ "i18nTextDefine_Node":"Node",
+ "i18nTextDefine_TerminalPoint":"Terminal Point",
+ "i18nTextDefine_RightPort":"Right Port",
+ "i18nTextDefine_PartnerNetwork":"Partner Network",
+ "i18nTextDefine_HostUrl":"Host Url",
+ "i18nTextDefine_deleteLink":"delete Link"
} \ No newline at end of file
diff --git a/usecaseui-portal/src/assets/i18n/zh.json b/usecaseui-portal/src/assets/i18n/zh.json
index c360c822..168ef95b 100644
--- a/usecaseui-portal/src/assets/i18n/zh.json
+++ b/usecaseui-portal/src/assets/i18n/zh.json
@@ -2,21 +2,125 @@
"Language":"--:",
"zh":"中文",
"en":"英文",
-
+
"app-component":"--:",
- "Home":"首页",
- "Services":"服务",
- "Services List":"服务列表",
- "Alarm":"告警",
- "Monitor":"监控",
- "Performance":"性能",
- "Network":"网云",
+ "i18nTextDefine_Home":"首页",
+ "i18nTextDefine_Customer":"用户",
+ "i18nTextDefine_Monitor":"监控",
+ "i18nTextDefine_Services":"服务",
+ "i18nTextDefine_ServicesList":"服务列表",
+ "i18nTextDefine_Onboard_VNF/VM":"分发 VNF/VM ",
+ "i18nTextDefine_Alarm":"告警",
+ "i18nTextDefine_Performance":"性能",
+ "i18nTextDefine_NetworkTopology":"网络拓扑",
"home-component":"--:",
- "Overall trend":"总体趋势",
- "SERVICES":"服务",
- "services":"条服务",
- "services has been created":"条已创建的服务",
- "PERFORMANCE":"性能",
- "VM Performance":"VM 性能"
+ "i18nTextDefine_SERVICES":"服务",
+ "i18nTextDefine_PACKAGE":"包",
+ "i18nTextDefine_Total":"总数",
+ "i18nTextDefine_cutomers_and":"用户 和 ",
+ "i18nTextDefine_service_intance":"服务实例",
+ "i18nTextDefine_ViewDetails":"查看详情",
+ "i18nTextDefine_ALARM":"告警",
+ "i18nTextDefine_DEVICES":"设备",
+ "i18nTextDefine_VNF_Alarm":"VNF 告警",
+ "i18nTextDefine_VM_Alarm":"VM 告警",
+ "i18nTextDefine_VM_Performance":"VM 性能",
+
+ "services-list-component":"--:",
+ "i18nTextDefine_ServiceType":"服务类型",
+ "i18nTextDefine_Create":"创建",
+ "i18nTextDefine_Failed":"失败",
+ "i18nTextDefine_Success":"成功",
+ "i18nTextDefine_InProgress":"执行中",
+ "i18nTextDefine_End_To_End_Service":"End To End 服务",
+ "i18nTextDefine_Network_Service":"Network 服务",
+ "i18nTextDefine_Cross_Domain_and_Cross_Layer_VPN":"跨域和跨层VPN",
+ "i18nTextDefine_NO":"序号",
+ "i18nTextDefine_Name":"名称",
+ "i18nTextDefine_Description":"描述",
+ "i18nTextDefine_UseCase":"使用实例",
+ "i18nTextDefine_Status":"状态",
+ "i18nTextDefine_Action":"功能",
+ "i18nTextDefine_Template":"模板",
+ "i18nTextDefine_ServiceCreation":"服务创建",
+ "i18nTextDefine_Cancel":"取消",
+ "i18nTextDefine_modelOk":"确认",
+ "i18nTextDefine_Scale":"缩扩容",
+ "i18nTextDefine_SureScale":"您确定缩放此实例吗?",
+ "i18nTextDefine_InstanceName":"实例名称",
+ "i18nTextDefine_InstanceID":"实例ID",
+ "i18nTextDefine_ScaleType":"缩扩容类型",
+ "i18nTextDefine_AspectId":"详情Id",
+ "i18nTextDefine_Number_Of_Steps":"级数",
+ "i18nTextDefine_ScalingDirection":"缩扩容方向",
+ "i18nTextDefine_delete":"删除",
+ "i18nTextDefine_SureDelete":"你确定删除此实例吗?",
+ "i18nTextDefine_terminationType":"终止类型",
+ "i18nTextDefine_graceful":"舒缓",
+ "i18nTextDefine_forceful":"强力",
+ "i18nTextDefine_gracefulTerminationTimeout":"舒缓终止超时时间",
+ "i18nTextDefine_Heal":"自愈",
+ "i18nTextDefine_SureHeal":"你确定自愈此实例吗?",
+ "i18nTextDefine_degreeHealing":"自愈程度",
+ "i18nTextDefine_healScript":"自愈脚本",
+ "i18nTextDefine_additionalParamsforNs":"为NS添加参数",
+ "i18nTextDefine_cause":"原因",
+ "i18nTextDefine_action":"功能",
+ "i18nTextDefine_actionvminfo":"操作虚拟机信息",
+
+ "ccvpn-creation-component":"--:",
+ "i18nTextDefine_InstanceCreation":"实例创建",
+ "i18nTextDefine_InstanceTopology":"实例拓扑",
+ "i18nTextDefine_Add":"新增",
+ "i18nTextDefine_topology":"拓扑",
+ "i18nTextDefine_PostCode":"邮编",
+ "i18nTextDefine_Address":"地址",
+ "i18nTextDefine_emails":"邮箱",
+ "i18nTextDefine_Base":"基本信息",
+ "i18nTextDefine_templateInputs":"模板输入",
+
+ "ccvpn-detail-component":"--:",
+ "i18nTextDefine_InstanceDetail":"实例详情",
+
+ "onboard-vnf-vm-component":"--:",
+ "i18nTextDefine_Click_CSAR_File":"单击或拖动CSAR文件",
+ "i18nTextDefine_Uploaded_files":"上传的文件",
+ "i18nTextDefine_Uploading":"上传中",
+ "i18nTextDefine_StartUpload":"开始上传",
+ "i18nTextDefine_File_upload_completed":"文件上传完成",
+ "i18nTextDefine_Version":"版本",
+ "i18nTextDefine_OnboardingState":"分发状态",
+ "i18nTextDefine_OperationalState":"运行状态",
+ "i18nTextDefine_UsageState":"使用状态",
+ "i18nTextDefine_Operationbutton":"操作按钮",
+
+ "management-component":"--:",
+ "i18nTextDefine_Create_initial_customer":"创建初始用户",
+ "i18nTextDefine_Customer_not_in_ONAP":"尚未在ONAP中创建用户",
+ "i18nTextDefine_createCustomer&serviceType":"请创建用户及其服务类型",
+ "i18nTextDefine_input_customerName":"输入用户名称",
+
+ "customer-component":"--:",
+ "i18nTextDefine_Instance_Count_of_Customer":"用户实例计数",
+ "i18nTextDefine_users":"用户",
+ "i18nTextDefine_Instance_Count_of_ServiceType":"服务类型计数",
+ "i18nTextDefine_Input_ServicesType":"输入服务类型",
+ "i18nTextDefine_Input_Sure_deleteCustomer":"你确定删除此用户吗?",
+ "i18nTextDefine_Input_Sure_deleteServiceType":"你确定删除此服务类型吗?",
+ "i18nTextDefine_CustomerName":"用户名称",
+ "i18nTextDefine_CustomerID":"用户ID",
+
+ "ccvpn-network-component":"--:",
+ "i18nTextDefine_AddLink":"添加链接",
+ "i18nTextDefine_SetAttribtes":"设置属性",
+ "i18nTextDefine_LinkName":"链接名称",
+ "i18nTextDefine_LeftPort":"左侧部分",
+ "i18nTextDefine_Network":"网云",
+ "i18nTextDefine_Node":"子节点",
+ "i18nTextDefine_TerminalPoint":"终端节点",
+ "i18nTextDefine_RightPort":"右侧部分",
+ "i18nTextDefine_PartnerNetwork":"合作方网云",
+ "i18nTextDefine_HostUrl":"主机网址",
+ "i18nTextDefine_deleteLink":"删除链接"
} \ No newline at end of file