Dashboard-list interface Multi-language 72/90072/3
authorcyuamber <xuranyjy@chinamobile.com>
Tue, 18 Jun 2019 09:55:30 +0000 (17:55 +0800)
committercyuamber <xuranyjy@chinamobile.com>
Tue, 18 Jun 2019 10:24:58 +0000 (18:24 +0800)
Change-Id: Ica069228d4d0165884a5adf44257a6243ca9fc00
Issue-ID: DCAEGEN2-1624
Signed-off-by: cyuamber <xuranyjy@chinamobile.com>
components/datalake-handler/admin/src/src/app/core/alert/alert.component.html
components/datalake-handler/admin/src/src/app/core/toastr-notification/toastr-notification.component.html
components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-list/dashboard-list.component.ts
components/datalake-handler/admin/src/src/app/header/header.component.ts
components/datalake-handler/admin/src/src/assets/i18n/en-us.json
components/datalake-handler/admin/src/src/assets/i18n/zh-hans.json
components/datalake-handler/admin/src/src/assets/i18n/zh-hant.json

index 48d7472..75c5b9d 100644 (file)
@@ -33,7 +33,7 @@ limitations under the License.
         </div>
         <div class="align-self-center p-1">
           <label class="alert-msg">
-            {{ this.message }}
+            {{ this.message  | translate }}
           </label>
         </div>
       </div>
index f89a158..026ce9c 100644 (file)
@@ -23,7 +23,7 @@ limitations under the License.
   <div class="toast {{cssClass(item) }}" aria-live="polite" style="display: block;">
     <button type="button" class="toast-close-button" role="button" (click)="removeNotification(item)">×</button>
     <div class="toast-message">
-      {{item.message}}
+      {{item.message  | translate}}
     </div>
   </div>
 </div>
index f0eac00..97bda85 100644 (file)
@@ -43,7 +43,6 @@ export class DashboardListComponent implements OnInit {
   loading: Boolean = true;
 
   tempDbDetail: Dashboard;
-  selectedLangs = sessionStorage.getItem("selectedLang") || "en-us";
   dashboardDeteleModelShow = true;
 
   // nameArr = [];
@@ -107,8 +106,6 @@ export class DashboardListComponent implements OnInit {
 
   openDashboardModal(thisIndex: number) {
     var modalRef, index;
-    this.selectedLangs = sessionStorage.getItem("selectedLang") || "en-us";
-    let tips = "";
     index = thisIndex;
     console.log(index, "index,add or edit");
     modalRef = this.modalService.open(CreateDashboardComponent, {
@@ -128,23 +125,9 @@ export class DashboardListComponent implements OnInit {
             console.log(res);
             if (res.statusCode == 200) {
               this.initData();
-              if (this.selectedLangs == "en-us") {
-                tips = "Success updated."
-              } else if (this.selectedLangs == "zh-hans") {
-                tips = "更新成功。"
-              } else if (this.selectedLangs == "zh-hant") {
-                tips = "更新成功。"
-              }
-              this.notificationService.success('"' + host + '"' + tips);
+              this.notificationService.success("SUCCESSFULLY_UPDATED");
             } else {
-              if (this.selectedLangs == "en-us") {
-                tips = "Fail updated."
-              } else if (this.selectedLangs == "zh-hans") {
-                tips = "更新失败。"
-              } else if (this.selectedLangs == "zh-hant") {
-                tips = "更新失敗。"
-              }
-              this.notificationService.error('"' + host + '"' + tips);
+              this.notificationService.error("FAILED_UPDATED");
             }
             modalRef.close();
           },
@@ -159,24 +142,10 @@ export class DashboardListComponent implements OnInit {
             console.log(res);
             if (res.statusCode == 200) {
               this.initData();
-              if (this.selectedLangs == "en-us") {
-                tips = "Success deleted."
-              } else if (this.selectedLangs == "zh-hans") {
-                tips = "删除成功。"
-              } else if (this.selectedLangs == "zh-hant") {
-                tips = "刪除成功。"
-              }
-              this.notificationService.success('"' + host + '"' + tips);
+              this.notificationService.success("SUCCESSFULLY_DELETED");
             } else {
               this.dbs[thisIndex].enabled = true;
-              if (this.selectedLangs == "en-us") {
-                tips = "Fail deleted."
-              } else if (this.selectedLangs == "zh-hans") {
-                tips = "删除失败。"
-              } else if (this.selectedLangs == "zh-hant") {
-                tips = "刪除失敗。"
-              }
-              this.notificationService.error('"' + host + '"' + tips);
+              this.notificationService.error("FAILED_DELETED");
             }
             modalRef.close();
           },
index 7551157..629c19e 100644 (file)
@@ -56,7 +56,6 @@ export class HeaderComponent {
     private translateService: TranslateService
   ) {
     this.translateService.setDefaultLang("en-us");
-    sessionStorage.setItem("selectedLang","en-us");
   }
 
   ngOnInit() {
@@ -75,7 +74,6 @@ export class HeaderComponent {
 
   changeLanguage(lang: string) {
     this.translateService.use(lang);
-    sessionStorage.setItem("selectedLang",lang);
   }
 
   changeFeederStatus() {
index d9645ce..67b916c 100644 (file)
@@ -14,7 +14,7 @@
   "SINK": "Sink",
   "AUTHENTICATION": "Authentication",
   "DATA_FORMAT": "Data format",
-  "TTL": "TTL",
+  "TTL": "TTL(days)",
   "SAVE_RAW_DATA": "Save raw data",
   "CORRELATE_CLEARED_MESSAGE": "Correlate cleared message",
   "DEFAULT_CONFIGURATIONS": "Default configurations",
@@ -26,7 +26,7 @@
   "BUCKET": "Bucket",
   "HOST": "Host",
   "PORT": "Port",
-  "ENABLE_SSL": "Enable SSL",
+  "ENABLE_SSL": "Encrypt Communication",
   "VERIFY": "Verify",
   "SETTING": "Setting",
 
   "DEPLOY_TO_DASHBOARD":"Deploy",
   "DEPLOY":"Deploy",
   "NEW_TEMPLATE":"New template",
-  "TEMPLATE_BODY":"Template Body"
+  "TEMPLATE_BODY":"Body",
+
+  "SUCCESSFULLY_CREARED":"Successfully created.",
+  "FAILED_CREARED":"Failed updated.",
+  "SUCCESSFULLY_UPDATED":"Successfully updated.",
+  "FAILED_UPDATED":"Failed updated.",
+  "SUCCESSFULLY_DELETED":"Successfully deleted.",
+  "FAILED_DELETED":"Failed deleted.",
+  "Deploy_SUCCESSFULLY":"Deploy successfully.",
+  "Deploy_FAILED":"Deploy failed.",
+  "ARE_YOU_SURE_DELETE":"Are you sure you want to delete it?"
+
 }
index 7fb095a..df90615 100644 (file)
@@ -14,7 +14,7 @@
   "SINK": "数据库",
   "AUTHENTICATION": "身份验证​",
   "DATA_FORMAT": "数据格式",
-  "TTL": "数据失效时间",
+  "TTL": "失效时间(天)",
   "SAVE_RAW_DATA": "保存原始数据",
   "CORRELATE_CLEARED_MESSAGE": "关联已清除的消息​",
   "DEFAULT_CONFIGURATIONS": "默认配置​",
@@ -26,7 +26,7 @@
   "BUCKET": "Bucket",
   "HOST": "主机​",
   "PORT": "端口​",
-  "ENABLE_SSL": "使用SSL​",
+  "ENABLE_SSL": "加密通信​",
   "VERIFY": "验证​",
   "SETTING": "设置",
 
   "DEPLOY_TO_DASHBOARD":"部署",
   "DEPLOY":"部署",
   "NEW_TEMPLATE":"新建模板",
-  "TEMPLATE_BODY":"模板体"
+  "TEMPLATE_BODY":"模板体",
+
+  "SUCCESSFULLY_CREARED":"创建成功",
+  "FAILED_CREARED":"创建失败",
+  "SUCCESSFULLY_UPDATED":"更新成功",
+  "FAILED_UPDATED":"更新失败",
+  "SUCCESSFULLY_DELETED":"删除成功",
+  "FAILED_DELETED":"删除失败",
+  "Deploy_SUCCESSFULLY":"部署成功",
+  "Deploy_FAILED":"部署失败",
+  "ARE_YOU_SURE_DELETE":"您确定您要删除吗?"
 }
index 7c935f4..2e6d280 100644 (file)
@@ -14,7 +14,7 @@
   "SINK": "資料庫",
   "AUTHENTICATION": "身份驗證​",
   "DATA_FORMAT": "檔案格式​",
-  "TTL": "存活時間​",
+  "TTL": "存活時間​(天)",
   "SAVE_RAW_DATA": "保存原始資料​",
   "CORRELATE_CLEARED_MESSAGE": "關聯已清除的訊息​",
   "DEFAULT_CONFIGURATIONS": "預設配置​",
@@ -27,7 +27,7 @@
   "BUCKET": "Bucket",
   "HOST": "主機",
   "PORT": "埠",
-  "ENABLE_SSL": "使用SSL​",
+  "ENABLE_SSL": "加密通信​",
   "VERIFY": "驗證​",
   "SETTING": "設定",
 
   "DEPLOY_TO_DASHBOARD":"部署",
   "DEPLOY":"部署",
   "NEW_TEMPLATE":"新建模板",
-  "TEMPLATE_BODY":"模板體"
+  "TEMPLATE_BODY":"模板體",
+
+  "SUCCESSFULLY_CREARED":"創建成功",
+  "FAILED_CREARED":"創建失败",
+  "SUCCESSFULLY_UPDATED":"更新成功",
+  "FAILED_UPDATED":"更新失败",
+  "SUCCESSFULLY_DELETED":"刪除成功",
+  "FAILED_DELETED":"删除失败",
+  "Deploy_SUCCESSFULLY":"部署成功",
+  "Deploy_FAILED":"部署失败",
+  "ARE_YOU_SURE_DELETE":"您確定您要刪除嗎?"
 }