From ce6111eae4451f17c20dc89879879db26d2c75b3 Mon Sep 17 00:00:00 2001 From: scarqin <1054139596@qq.com> Date: Wed, 2 Nov 2022 12:19:38 +0800 Subject: [PATCH] translate --- .../services/language/language.service.ts | 9 +- .../group/tree/api-group-tree.component.html | 2 +- .../group/tree/api-group-tree.component.scss | 4 +- .../app/pages/navbar/navbar.component.html | 2 +- .../src/app/pages/navbar/navbar.component.ts | 11 +- .../manage-access.component.html | 2 +- .../data-source/data-source.service.ts | 1 - src/workbench/browser/src/locale/messages.xlf | 203 ++++++++--------- .../browser/src/locale/messages.zh.xlf | 214 +++++++++--------- 9 files changed, 220 insertions(+), 228 deletions(-) diff --git a/src/workbench/browser/src/app/core/services/language/language.service.ts b/src/workbench/browser/src/app/core/services/language/language.service.ts index 12a3a57a..8e100400 100644 --- a/src/workbench/browser/src/app/core/services/language/language.service.ts +++ b/src/workbench/browser/src/app/core/services/language/language.service.ts @@ -14,9 +14,11 @@ export class LanguageService { this.setting.getSettings()?.['eoapi-language'] || this.languages.find((val) => window.location.href.includes(`/${val.path}`))?.value || (navigator.language.includes('zh') ? 'zh-Hans' : 'en-US'); - + langHashMap = new Map().set('zh-Hans', 'zh').set('en-US', 'en'); constructor(private electron: ElectronService, private setting: SettingService) {} - + get langHash() { + return this.langHashMap.get(this.systemLanguage); + } init() { this.changeLanguage(this.setting.getSettings()?.['eoapi-language']); } @@ -34,8 +36,7 @@ export class LanguageService { }); } else { const url = window.location.href; - const langHash = new Map().set('zh-Hans', 'zh').set('en-US', 'en'); - window.location.replace(url.replace(/\/(zh|en)\/home\//, `/${langHash.get(localeID)}/home/`)); + window.location.replace(url.replace(/\/(zh|en)\/home\//, `/${this.langHashMap.get(localeID)}/home/`)); } } } diff --git a/src/workbench/browser/src/app/pages/api/group/tree/api-group-tree.component.html b/src/workbench/browser/src/app/pages/api/group/tree/api-group-tree.component.html index 95504d8d..b30117c9 100644 --- a/src/workbench/browser/src/app/pages/api/group/tree/api-group-tree.component.html +++ b/src/workbench/browser/src/app/pages/api/group/tree/api-group-tree.component.html @@ -33,7 +33,7 @@ -
+