diff options
author | cyuamber <xuranyjy@chinamobile.com> | 2019-06-18 17:55:30 +0800 |
---|---|---|
committer | cyuamber <xuranyjy@chinamobile.com> | 2019-06-18 18:24:58 +0800 |
commit | 78ce184d72dcc2ba48041b1893619f66a29ecd5d (patch) | |
tree | f1b65d23022caa7eef697ba10073c70257eb8582 /components/datalake-handler/admin/src | |
parent | 9d53025f85bd4d06ce2e6e859362c62c267cf178 (diff) |
Dashboard-list interface Multi-language
Change-Id: Ica069228d4d0165884a5adf44257a6243ca9fc00
Issue-ID: DCAEGEN2-1624
Signed-off-by: cyuamber <xuranyjy@chinamobile.com>
Diffstat (limited to 'components/datalake-handler/admin/src')
7 files changed, 46 insertions, 48 deletions
diff --git a/components/datalake-handler/admin/src/src/app/core/alert/alert.component.html b/components/datalake-handler/admin/src/src/app/core/alert/alert.component.html index 48d74721..75c5b9d5 100644 --- a/components/datalake-handler/admin/src/src/app/core/alert/alert.component.html +++ b/components/datalake-handler/admin/src/src/app/core/alert/alert.component.html @@ -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> diff --git a/components/datalake-handler/admin/src/src/app/core/toastr-notification/toastr-notification.component.html b/components/datalake-handler/admin/src/src/app/core/toastr-notification/toastr-notification.component.html index f89a1586..026ce9c3 100644 --- a/components/datalake-handler/admin/src/src/app/core/toastr-notification/toastr-notification.component.html +++ b/components/datalake-handler/admin/src/src/app/core/toastr-notification/toastr-notification.component.html @@ -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> diff --git a/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-list/dashboard-list.component.ts b/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-list/dashboard-list.component.ts index f0eac009..97bda850 100644 --- a/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-list/dashboard-list.component.ts +++ b/components/datalake-handler/admin/src/src/app/dashboard-setting/dashboard-list/dashboard-list.component.ts @@ -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(); }, diff --git a/components/datalake-handler/admin/src/src/app/header/header.component.ts b/components/datalake-handler/admin/src/src/app/header/header.component.ts index 7551157d..629c19e5 100644 --- a/components/datalake-handler/admin/src/src/app/header/header.component.ts +++ b/components/datalake-handler/admin/src/src/app/header/header.component.ts @@ -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() { diff --git a/components/datalake-handler/admin/src/src/assets/i18n/en-us.json b/components/datalake-handler/admin/src/src/assets/i18n/en-us.json index d9645cea..67b916c8 100644 --- a/components/datalake-handler/admin/src/src/assets/i18n/en-us.json +++ b/components/datalake-handler/admin/src/src/assets/i18n/en-us.json @@ -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", @@ -59,5 +59,16 @@ "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?" + } diff --git a/components/datalake-handler/admin/src/src/assets/i18n/zh-hans.json b/components/datalake-handler/admin/src/src/assets/i18n/zh-hans.json index 7fb095a4..df90615b 100644 --- a/components/datalake-handler/admin/src/src/assets/i18n/zh-hans.json +++ b/components/datalake-handler/admin/src/src/assets/i18n/zh-hans.json @@ -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": "设置", @@ -58,5 +58,15 @@ "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":"您确定您要删除吗?" } diff --git a/components/datalake-handler/admin/src/src/assets/i18n/zh-hant.json b/components/datalake-handler/admin/src/src/assets/i18n/zh-hant.json index 7c935f40..2e6d280a 100644 --- a/components/datalake-handler/admin/src/src/assets/i18n/zh-hant.json +++ b/components/datalake-handler/admin/src/src/assets/i18n/zh-hant.json @@ -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": "設定", @@ -59,5 +59,15 @@ "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":"您確定您要刪除嗎?" } |