From 64f7de47dc2f6fea1da6b64412d4ab468135f35d Mon Sep 17 00:00:00 2001 From: Hintay Date: Sun, 20 Feb 2022 18:56:27 +0800 Subject: [PATCH] Added internationalize, and fixed some small bugs. --- frontend/Makefile | 4 + .../src/components/Breadcrumb/Breadcrumb.vue | 2 +- frontend/src/layouts/BaseLayout.vue | 1 + frontend/src/layouts/HeaderLayout.vue | 3 +- frontend/src/layouts/SideBar.vue | 2 +- frontend/src/lib/translate/gettext.js | 16 +- frontend/src/locale/en/LC_MESSAGES/app.po | 371 ++++++++++++++-- frontend/src/locale/en/LC_MESSAGES/app.po~ | 123 ------ frontend/src/locale/zh_CN/LC_MESSAGES/app.mo | Bin 1510 -> 0 bytes frontend/src/locale/zh_CN/LC_MESSAGES/app.po | 403 +++++++++++++++--- frontend/src/locale/zh_TW/LC_MESSAGES/app.po | 371 ++++++++++++++-- frontend/src/locale/zh_TW/LC_MESSAGES/app.po~ | 122 ------ frontend/src/main.js | 2 +- frontend/src/router/index.js | 32 +- frontend/src/views/config/Config.vue | 11 +- frontend/src/views/config/ConfigEdit.vue | 13 +- frontend/src/views/dashboard/DashBoard.vue | 20 +- frontend/src/views/domain/CertInfo.vue | 16 +- frontend/src/views/domain/DomainAdd.vue | 15 +- frontend/src/views/domain/DomainEdit.vue | 44 +- frontend/src/views/domain/DomainList.vue | 29 +- frontend/src/views/domain/columns.js | 28 +- frontend/src/views/other/About.vue | 17 +- frontend/src/views/other/Error.vue | 2 +- frontend/src/views/other/Home.vue | 18 - frontend/src/views/other/Install.vue | 28 +- frontend/src/views/other/Login.vue | 18 +- frontend/src/views/user/User.vue | 13 +- frontend/version.json | 2 +- go.mod | 2 +- go.sum | 4 - main.go | 2 +- 32 files changed, 1181 insertions(+), 553 deletions(-) delete mode 100644 frontend/src/locale/en/LC_MESSAGES/app.po~ delete mode 100644 frontend/src/locale/zh_CN/LC_MESSAGES/app.mo delete mode 100644 frontend/src/locale/zh_TW/LC_MESSAGES/app.po~ delete mode 100644 frontend/src/views/other/Home.vue diff --git a/frontend/Makefile b/frontend/Makefile index 8ed2d18e..be3ba03f 100644 --- a/frontend/Makefile +++ b/frontend/Makefile @@ -6,7 +6,11 @@ LOGNAME ?= $(shell logname) # adding the name of the user's login name to the template file, so that # on a multi-user system several users can run this without interference +ifeq ($(OS),Windows_NT) +TEMPLATE_POT ?= ./template-$(LOGNAME).pot +else TEMPLATE_POT ?= /tmp/template-$(LOGNAME).pot +endif # Where to find input files (it can be multiple paths). INPUT_FILES = ./src diff --git a/frontend/src/components/Breadcrumb/Breadcrumb.vue b/frontend/src/components/Breadcrumb/Breadcrumb.vue index 4a3a2ead..37dc58d4 100644 --- a/frontend/src/components/Breadcrumb/Breadcrumb.vue +++ b/frontend/src/components/Breadcrumb/Breadcrumb.vue @@ -2,7 +2,7 @@ {{ item.name }} diff --git a/frontend/src/layouts/BaseLayout.vue b/frontend/src/layouts/BaseLayout.vue index 7646ff03..dbe720af 100644 --- a/frontend/src/layouts/BaseLayout.vue +++ b/frontend/src/layouts/BaseLayout.vue @@ -50,6 +50,7 @@ import FooterLayout from './FooterLayout' import PageHeader from '@/components/PageHeader/PageHeader' import zh_CN from 'ant-design-vue/es/locale/zh_CN' +// TODO: Change language for base layout. export default { name: 'BaseLayout', data() { diff --git a/frontend/src/layouts/HeaderLayout.vue b/frontend/src/layouts/HeaderLayout.vue index 47a0734d..d24323ee 100644 --- a/frontend/src/layouts/HeaderLayout.vue +++ b/frontend/src/layouts/HeaderLayout.vue @@ -19,13 +19,14 @@ diff --git a/frontend/src/views/other/Error.vue b/frontend/src/views/other/Error.vue index 0b93da55..dce22d36 100644 --- a/frontend/src/views/other/Error.vue +++ b/frontend/src/views/other/Error.vue @@ -1,7 +1,7 @@ diff --git a/frontend/src/views/other/Home.vue b/frontend/src/views/other/Home.vue deleted file mode 100644 index 841c40c4..00000000 --- a/frontend/src/views/other/Home.vue +++ /dev/null @@ -1,18 +0,0 @@ - - - diff --git a/frontend/src/views/other/Install.vue b/frontend/src/views/other/Install.vue index c988382d..9da5f69f 100644 --- a/frontend/src/views/other/Install.vue +++ b/frontend/src/views/other/Install.vue @@ -4,7 +4,7 @@

Nginx UI

diff --git a/frontend/src/views/other/Login.vue b/frontend/src/views/other/Login.vue index 7ac006f5..d5ac4f88 100644 --- a/frontend/src/views/other/Login.vue +++ b/frontend/src/views/other/Login.vue @@ -13,9 +13,9 @@ @@ -24,17 +24,17 @@ - - 登录 + + Login @@ -46,6 +46,8 @@