From 40b099a978441e3f9107c79b67785c24ad2ac3f5 Mon Sep 17 00:00:00 2001 From: ssongliu <73214554+ssongliu@users.noreply.github.com> Date: Mon, 27 Jan 2025 19:06:26 +0800 Subject: [PATCH] feat: Improve the internationalization of the frontend. (#7778) --- agent/init/dir/dir.go | 13 - agent/init/hook/hook.go | 11 + frontend/src/components/app-status/index.vue | 2 +- frontend/src/components/backup/index.vue | 2 +- .../src/components/container-log/index.vue | 6 +- frontend/src/components/log-dialog/index.vue | 2 +- frontend/src/components/log-file/index.vue | 2 +- frontend/src/components/task-list/index.vue | 2 +- frontend/src/lang/modules/en.ts | 730 +++++++++++++--- frontend/src/lang/modules/ja.ts | 766 ++++++++++++++--- frontend/src/lang/modules/ko.ts | 754 ++++++++++++++--- frontend/src/lang/modules/ms.ts | 783 ++++++++++++++--- frontend/src/lang/modules/pt-br.ts | 787 ++++++++++++++--- frontend/src/lang/modules/ru.ts | 789 ++++++++++++++--- frontend/src/lang/modules/tw.ts | 679 ++++++++++++--- frontend/src/lang/modules/zh.ts | 791 +++++++++++++++--- .../components/Tabs/components/TabItem.vue | 2 +- frontend/src/views/app-store/apps/index.vue | 2 +- frontend/src/views/app-store/detail/index.vue | 2 +- .../views/app-store/detail/install/index.vue | 2 +- .../views/app-store/detail/params/index.vue | 2 +- .../views/app-store/installed/check/index.vue | 4 +- .../app-store/installed/detail/index.vue | 2 +- .../src/views/app-store/installed/index.vue | 8 +- .../views/container/compose/create/index.vue | 4 +- .../views/container/compose/detail/index.vue | 16 +- .../src/views/container/compose/index.vue | 6 +- .../src/views/container/container/index.vue | 22 +- .../container/container/monitor/index.vue | 8 +- .../container/container/operate/index.vue | 2 +- .../container/container/terminal/index.vue | 4 +- .../src/views/container/dashboard/index.vue | 2 +- .../src/views/container/image/pull/index.vue | 2 +- .../src/views/container/image/tag/index.vue | 2 +- frontend/src/views/container/index.vue | 4 +- .../src/views/container/setting/index.vue | 6 +- .../src/views/container/template/index.vue | 2 +- .../container/template/operator/index.vue | 2 +- .../views/container/volume/create/index.vue | 2 +- frontend/src/views/cronjob/backup/index.vue | 2 +- frontend/src/views/cronjob/index.vue | 8 +- frontend/src/views/cronjob/operate/index.vue | 6 +- frontend/src/views/cronjob/record/index.vue | 10 +- .../src/views/database/mysql/check/index.vue | 2 +- .../src/views/database/mysql/conn/index.vue | 4 +- frontend/src/views/database/mysql/index.vue | 2 +- .../views/database/mysql/setting/index.vue | 2 +- .../database/mysql/setting/slow-log/index.vue | 2 +- .../views/database/postgresql/check/index.vue | 2 +- .../views/database/postgresql/conn/index.vue | 4 +- .../src/views/database/postgresql/index.vue | 2 +- .../database/postgresql/setting/index.vue | 2 +- .../src/views/database/redis/check/index.vue | 2 +- .../src/views/database/redis/conn/index.vue | 4 +- frontend/src/views/database/redis/index.vue | 2 +- .../redis/setting/persistence/index.vue | 2 +- frontend/src/views/home/app/index.vue | 6 +- frontend/src/views/home/index.vue | 4 +- .../file-management/code-editor/index.vue | 4 +- .../host/file-management/delete/index.vue | 2 +- .../host/file-management/download/index.vue | 2 +- .../src/views/host/file-management/index.vue | 21 +- .../views/host/file-management/move/index.vue | 2 +- .../recycle-bin/delete/index.vue | 2 +- .../host/file-management/upload/index.vue | 6 +- .../views/host/file-management/wget/index.vue | 2 +- .../src/views/host/firewall/forward/index.vue | 2 +- frontend/src/views/host/firewall/ip/index.vue | 2 +- .../src/views/host/firewall/port/index.vue | 2 +- .../host/firewall/port/operate/index.vue | 2 +- .../src/views/host/firewall/status/index.vue | 2 +- frontend/src/views/host/monitor/index.vue | 2 +- .../src/views/host/monitor/monitor/index.vue | 12 +- .../src/views/host/process/network/index.vue | 2 +- .../host/process/process/detail/index.vue | 8 +- .../src/views/host/process/process/index.vue | 2 +- frontend/src/views/host/ssh/session/index.vue | 4 +- frontend/src/views/host/ssh/ssh/index.vue | 2 +- .../src/views/host/ssh/ssh/pubkey/index.vue | 2 +- frontend/src/views/log/operation/index.vue | 2 +- frontend/src/views/log/task/index.vue | 2 +- frontend/src/views/log/website/index.vue | 4 +- frontend/src/views/setting/license/index.vue | 2 +- .../views/setting/panel/theme-color/index.vue | 4 +- .../views/setting/snapshot/create/index.vue | 2 +- frontend/src/views/setting/snapshot/index.vue | 6 +- .../views/setting/snapshot/status/index.vue | 22 +- frontend/src/views/terminal/command/index.vue | 4 +- frontend/src/views/terminal/host/index.vue | 4 +- .../src/views/toolbox/clam/operate/index.vue | 4 +- .../src/views/toolbox/clam/record/index.vue | 6 +- .../src/views/toolbox/clam/status/index.vue | 4 +- frontend/src/views/toolbox/clean/index.vue | 10 +- frontend/src/views/toolbox/fail2ban/index.vue | 2 +- frontend/src/views/toolbox/ftp/index.vue | 4 +- frontend/src/views/toolbox/ftp/log/index.vue | 10 +- .../views/toolbox/supervisor/config/index.vue | 2 +- .../src/views/toolbox/supervisor/index.vue | 4 +- .../views/toolbox/supervisor/status/index.vue | 2 +- .../src/views/website/runtime/app/index.vue | 2 +- .../views/website/runtime/dotnet/index.vue | 8 +- .../src/views/website/runtime/go/index.vue | 8 +- .../src/views/website/runtime/java/index.vue | 8 +- .../src/views/website/runtime/node/index.vue | 8 +- .../website/runtime/node/module/index.vue | 10 +- .../views/website/runtime/php/check/index.vue | 4 +- .../runtime/php/config/function/index.vue | 2 +- .../website/runtime/php/create/index.vue | 10 +- .../php/extension-management/index.vue | 4 +- .../runtime/php/extension-template/index.vue | 2 +- .../src/views/website/runtime/php/index.vue | 14 +- .../website/runtime/php/supervisor/index.vue | 4 +- .../views/website/runtime/python/index.vue | 8 +- frontend/src/views/website/ssl/index.vue | 6 +- .../src/views/website/website/check/index.vue | 2 +- .../website/config/basic/domain/index.vue | 2 +- .../config/basic/load-balance/index.vue | 2 +- .../website/config/basic/php/index.vue | 2 +- .../website/config/basic/proxy/index.vue | 2 +- .../website/config/basic/redirect/index.vue | 2 +- .../website/config/basic/rewrite/index.vue | 2 +- .../views/website/website/config/index.vue | 4 +- .../views/website/website/create/index.vue | 4 +- frontend/src/views/website/website/index.vue | 6 +- .../src/views/website/website/nginx/index.vue | 4 +- 125 files changed, 5365 insertions(+), 1245 deletions(-) diff --git a/agent/init/dir/dir.go b/agent/init/dir/dir.go index ca8820f36..773a892b9 100644 --- a/agent/init/dir/dir.go +++ b/agent/init/dir/dir.go @@ -3,8 +3,6 @@ package dir import ( "path" - "github.com/1Panel-dev/1Panel/agent/app/model" - "github.com/1Panel-dev/1Panel/agent/constant" "github.com/1Panel-dev/1Panel/agent/global" "github.com/1Panel-dev/1Panel/agent/utils/files" ) @@ -30,15 +28,4 @@ func Init() { global.Dir.RuntimeDir, _ = fileOp.CreateDirWithPath(true, path.Join(baseDir, "1panel/runtime")) global.Dir.RecycleBinDir, _ = fileOp.CreateDirWithPath(true, "/.1panel_clash") global.Dir.SSLLogDir, _ = fileOp.CreateDirWithPath(true, path.Join(baseDir, "1panel/log/ssl")) - - //loadLocalDir() -} - -func loadLocalDir() { - var account model.BackupAccount - if err := global.DB.Where("`type` = ?", constant.Local).First(&account).Error; err != nil { - global.LOG.Errorf("load local backup account info failed, err: %v", err) - return - } - global.Dir.LocalBackupDir = account.BackupPath } diff --git a/agent/init/hook/hook.go b/agent/init/hook/hook.go index 7bb58918a..8f826553c 100644 --- a/agent/init/hook/hook.go +++ b/agent/init/hook/hook.go @@ -17,6 +17,8 @@ func Init() { initGlobalData() handleCronjobStatus() handleSnapStatus() + + loadLocalDir() } func initGlobalData() { @@ -92,3 +94,12 @@ func handleCronJobAlert(cronjob *model.Cronjob) { return } } + +func loadLocalDir() { + var account model.BackupAccount + if err := global.DB.Where("`type` = ?", constant.Local).First(&account).Error; err != nil { + global.LOG.Errorf("load local backup account info failed, err: %v", err) + return + } + global.Dir.LocalBackupDir = account.BackupPath +} diff --git a/frontend/src/components/app-status/index.vue b/frontend/src/components/app-status/index.vue index 4f2daf9ff..080d9320e 100644 --- a/frontend/src/components/app-status/index.vue +++ b/frontend/src/components/app-status/index.vue @@ -28,7 +28,7 @@ :disabled="data.status === 'Installing'" @click="onOperate('restart')" > - {{ $t('app.restart') }} + {{ $t('commons.button.restart') }} - + - +