From e316f0daf5fe01a9e717c4857661cdb4fca73edf Mon Sep 17 00:00:00 2001 From: cae545e5 <1876869218@qq.com> Date: Wed, 16 Apr 2025 11:30:52 +0800 Subject: [PATCH 01/75] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=20vue-i18n=20?= =?UTF-8?q?=E5=9B=BD=E9=99=85=E5=8C=96=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/package.json | 1 + ui/yarn.lock | 54 ++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 54 insertions(+), 1 deletion(-) diff --git a/ui/package.json b/ui/package.json index 4c0c90c14..a8ce38c11 100644 --- a/ui/package.json +++ b/ui/package.json @@ -31,6 +31,7 @@ "uuid": "^8.3.2", "vue": "^3.0.5", "vue-clipboard3": "^1.0.1", + "vue-i18n": "9.0.0", "vue-router": "^4.0.5", "vuex": "^4.0.0", "yaml": "^2.0.0-5" diff --git a/ui/yarn.lock b/ui/yarn.lock index 5097e0b44..18a7de430 100644 --- a/ui/yarn.lock +++ b/ui/yarn.lock @@ -514,6 +514,44 @@ minimatch "^3.0.4" strip-json-comments "^3.1.1" +"@intlify/core-base@9.0.0": + version "9.0.0" + resolved "https://registry.npmmirror.com/@intlify/core-base/-/core-base-9.0.0.tgz#3de223b8532c535d022e5be58f7d56a26d2fb12f" + integrity sha512-dxqakT94EV2bFshG3LENQUPWX9yJFCga1BOwJ6mz7J8LnAYVB9Kxw7NRyE2ybN31USW2IUTQH6WWR1yDbCiefQ== + dependencies: + "@intlify/message-compiler" "9.0.0" + "@intlify/message-resolver" "9.0.0" + "@intlify/runtime" "9.0.0" + "@intlify/shared" "9.0.0" + +"@intlify/message-compiler@9.0.0": + version "9.0.0" + resolved "https://registry.npmmirror.com/@intlify/message-compiler/-/message-compiler-9.0.0.tgz#8a1079f8aebcde33057ce769817691ce27ad3e0d" + integrity sha512-3oiLj+8z6koRYJwknazjilBsrqnJEAJywr/t39MYVy2yPmwOI1+NDfdDwM9U3ioA2RvsQEUICqW8gmjq1YIElw== + dependencies: + "@intlify/message-resolver" "9.0.0" + "@intlify/shared" "9.0.0" + source-map "0.6.1" + +"@intlify/message-resolver@9.0.0": + version "9.0.0" + resolved "https://registry.npmmirror.com/@intlify/message-resolver/-/message-resolver-9.0.0.tgz#0077ec24606b6486d238bdef9044e27729f4782c" + integrity sha512-LVK4cwu1l33yvBy0UQkEdXm6pZUcbbiparobruJXz+U8jRTmYHBprN59j59YKXEKcV43cHfzNveaQIm84bgxvQ== + +"@intlify/runtime@9.0.0": + version "9.0.0" + resolved "https://registry.npmmirror.com/@intlify/runtime/-/runtime-9.0.0.tgz#bf9415ff90c746a9be38a5c32f71cbbe9848eee8" + integrity sha512-UqCKduZezb5/qA+XPRfHVvXoLmhnQ8iKMyCh0Lg3ZwjW2vOMep/AgZU3T9cgESe67r4buPYHs7nOBSHbTdjNxg== + dependencies: + "@intlify/message-compiler" "9.0.0" + "@intlify/message-resolver" "9.0.0" + "@intlify/shared" "9.0.0" + +"@intlify/shared@9.0.0": + version "9.0.0" + resolved "https://registry.npmmirror.com/@intlify/shared/-/shared-9.0.0.tgz#d85b3b5f9033f377c5cf2202cf2459aa49948f36" + integrity sha512-0r4v7dnY8g/Jfx2swUWy2GyfH/WvIpWvkU4OIupvxDTWiE8RhcpbOCVvqpVh/xGi0proHQ/r2Dhc0QSItUsfDQ== + "@jridgewell/resolve-uri@^3.0.3": version "3.1.0" resolved "https://registry.npmmirror.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz#2203b118c157721addfe69d47b70465463066d78" @@ -774,6 +812,11 @@ "@vue/compiler-dom" "3.0.11" "@vue/shared" "3.0.11" +"@vue/devtools-api@^6.0.0-beta.5": + version "6.6.4" + resolved "https://registry.npmmirror.com/@vue/devtools-api/-/devtools-api-6.6.4.tgz#cbe97fe0162b365edc1dba80e173f90492535343" + integrity sha512-sGhTPMuXqZ1rVOk32RylztWkfXTRhuS7vgAKv0zjqk8gbsHkJ7xfFf+jbySxt7tWObEJwyKaHMikV/WGDiQm8g== + "@vue/eslint-config-prettier@^7.0.0": version "7.0.0" resolved "https://registry.npmmirror.com/@vue/eslint-config-prettier/-/eslint-config-prettier-7.0.0.tgz#44ab55ca22401102b57795c59428e9dade72be34" @@ -3367,7 +3410,7 @@ smart-tagz@^0.2.0: dependencies: vue-feather-icons "^5.1.0" -source-map@^0.6.1, source-map@~0.6.0: +source-map@0.6.1, source-map@^0.6.1, source-map@~0.6.0: version "0.6.1" resolved "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== @@ -3777,6 +3820,15 @@ vue-feather-icons@^5.1.0: dependencies: babel-helper-vue-jsx-merge-props "^2.0.2" +vue-i18n@9.0.0: + version "9.0.0" + resolved "https://registry.npmmirror.com/vue-i18n/-/vue-i18n-9.0.0.tgz#a04c41d5ed3d5a068e923517bfaa0abcbc84e174" + integrity sha512-iks0eJDv/4cK/7tl/ooMUroNVVIGOK4kKS1PIHmPQk7QjT/sDfFM84vjPKgpARbw0GjJsOiADL43jufNfs9e9A== + dependencies: + "@intlify/core-base" "9.0.0" + "@intlify/shared" "9.0.0" + "@vue/devtools-api" "^6.0.0-beta.5" + vue-router@^4.0.5: version "4.0.6" resolved "https://registry.npmmirror.com/vue-router/-/vue-router-4.0.6.tgz#91750db507d26642f225b0ec6064568e5fe448d6" -- Gitee From 90f9968e4d1aceade02d0a9ef88006b6f57cbcf3 Mon Sep 17 00:00:00 2001 From: cae545e5 <1876869218@qq.com> Date: Wed, 16 Apr 2025 11:34:11 +0800 Subject: [PATCH 02/75] =?UTF-8?q?feat:=20=E5=AE=9E=E7=8E=B0=E5=9B=BD?= =?UTF-8?q?=E9=99=85=E5=8C=96=E9=80=BB=E8=BE=91=EF=BC=8C=E9=9B=86=E6=88=90?= =?UTF-8?q?=20vue-i18n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/src/locales/index.ts | 36 ++++++++++++++++++++++++++++++++++++ ui/src/main.ts | 7 +++---- ui/src/utils/i18n.ts | 16 ++++++++++++++++ 3 files changed, 55 insertions(+), 4 deletions(-) create mode 100644 ui/src/locales/index.ts create mode 100644 ui/src/utils/i18n.ts diff --git a/ui/src/locales/index.ts b/ui/src/locales/index.ts new file mode 100644 index 000000000..688300b74 --- /dev/null +++ b/ui/src/locales/index.ts @@ -0,0 +1,36 @@ +import { createI18n } from 'vue-i18n'; + +const messages = { + zh: { + top: { + logout: '退出', + language: '语言设置', + }, + }, + + en: { + top: { + logout: 'Logout', + language: 'Language', + }, + }, +}; + +const getDefaultLocale = () => { + const saved = localStorage.getItem('JianmuLang'); + if (saved) return saved; + + const browserLang = navigator.language.split('-')[0]; + const supportedLangs = ['zh', 'en']; + const lang = supportedLangs.includes(browserLang) ? browserLang : 'zh'; + localStorage.setItem('JianmuLang', lang); + return lang; +}; + +const i18n = createI18n({ + locale: getDefaultLocale(), + fallbackLocale: 'zh', + messages, +}); + +export default i18n; diff --git a/ui/src/main.ts b/ui/src/main.ts index 147442989..2f37b3298 100644 --- a/ui/src/main.ts +++ b/ui/src/main.ts @@ -9,7 +9,7 @@ import { globalErrorHandler } from './utils/global-error-handler'; import './utils/operation-btn-position.ts'; // 安装百度统计 import './utils/baidu-tongji.ts'; - +import i18n from './locales'; // 打印环境变量,用于调试 console.debug(import.meta.env); const app = createApp(App); @@ -21,10 +21,9 @@ app.use(components); app.use(router); // 安装vuex app.use(store); - +app.use(i18n); // 注册全局异常处理方法 -app.config.errorHandler = (err, instance, info) => - globalErrorHandler(err as Error, instance, info, router, store); +app.config.errorHandler = (err, instance, info) => globalErrorHandler(err as Error, instance, info, router, store); app.config.globalProperties.$throw = (err: Error, instance: ComponentPublicInstance | null) => globalErrorHandler(err, instance, null, router, store); diff --git a/ui/src/utils/i18n.ts b/ui/src/utils/i18n.ts new file mode 100644 index 000000000..515520c7b --- /dev/null +++ b/ui/src/utils/i18n.ts @@ -0,0 +1,16 @@ +import { useI18n } from 'vue-i18n'; + +export function useLocale() { + const { locale, t } = useI18n(); + + const handleLocaleChange = (lang: string) => { + locale.value = lang; + localStorage.setItem('JianmuLang', lang); + }; + + return { + t, + locale, + handleLocaleChange, + }; +} -- Gitee From d48e10dbeccdc1d06893b17703fd68a689d10b75 Mon Sep 17 00:00:00 2001 From: cae545e5 <1876869218@qq.com> Date: Wed, 16 Apr 2025 11:37:06 +0800 Subject: [PATCH 03/75] =?UTF-8?q?feat:=20=E5=AE=9E=E7=8E=B0=E5=9B=BD?= =?UTF-8?q?=E9=99=85=E5=8C=96=E9=80=BB=E8=BE=91=EF=BC=8C=E9=9B=86=E6=88=90?= =?UTF-8?q?=20vue-i18n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -- Gitee From 4e6492d0fcf08721eefea98774aa00ca1b918ca7 Mon Sep 17 00:00:00 2001 From: cae545e5 <1876869218@qq.com> Date: Wed, 16 Apr 2025 11:38:12 +0800 Subject: [PATCH 04/75] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E8=AF=AD?= =?UTF-8?q?=E8=A8=80=E5=88=87=E6=8D=A2=E8=8F=9C=E5=8D=95=E5=92=8C=E5=9B=BD?= =?UTF-8?q?=E9=99=85=E5=8C=96=E6=96=87=E6=9C=AC=E6=B8=B2=E6=9F=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/src/views/nav/top.vue | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/ui/src/views/nav/top.vue b/ui/src/views/nav/top.vue index 64a061a00..a481b3888 100644 --- a/ui/src/views/nav/top.vue +++ b/ui/src/views/nav/top.vue @@ -47,7 +47,30 @@ @@ -66,11 +89,12 @@ import { ISessionVo } from '@/api/dto/session'; import { version as v } from '@/../package.json'; import { IRootState } from '@/model'; import { IVersionVo } from '@/api/dto/common'; - +import { useLocale } from '@/utils/i18n'; const { mapMutations } = createNamespacedHelpers(namespace); export default defineComponent({ setup() { + const { t, locale, handleLocaleChange } = useLocale(); const { proxy } = getCurrentInstance() as any; const router = useRouter(); const store = useStore(); @@ -94,6 +118,9 @@ export default defineComponent({ }); return { + t, + locale, + handleLocaleChange, authMode, loaded, loginType, -- Gitee From f59ac3004cafaa20563c51875a500d4705ac9fd4 Mon Sep 17 00:00:00 2001 From: cae545e5 <1876869218@qq.com> Date: Wed, 16 Apr 2025 14:14:35 +0800 Subject: [PATCH 05/75] =?UTF-8?q?feat:=20=E5=AE=9E=E7=8E=B0=E5=BA=95?= =?UTF-8?q?=E9=83=A8=E5=AF=BC=E8=88=AA=E6=96=87=E6=9C=AC=E5=9B=BD=E9=99=85?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/src/locales/index.ts | 12 ++++++++++++ ui/src/views/nav/bottom2.vue | 12 +++++------- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/ui/src/locales/index.ts b/ui/src/locales/index.ts index 688300b74..30e759466 100644 --- a/ui/src/locales/index.ts +++ b/ui/src/locales/index.ts @@ -6,6 +6,12 @@ const messages = { logout: '退出', language: '语言设置', }, + bottom2: { + project: '木兰社区孵化项目', + about: '关于建木', + manual: '使用手册', + contact: '联系我们', + }, }, en: { @@ -13,6 +19,12 @@ const messages = { logout: 'Logout', language: 'Language', }, + bottom2: { + project: 'Mulan Incubator', + about: 'About Jianmu', + manual: 'Documentation', + contact: 'Contact Us', + }, }, }; diff --git a/ui/src/views/nav/bottom2.vue b/ui/src/views/nav/bottom2.vue index 3dfb3053d..8abfdd02a 100644 --- a/ui/src/views/nav/bottom2.vue +++ b/ui/src/views/nav/bottom2.vue @@ -1,14 +1,12 @@ @@ -45,7 +43,7 @@ export default defineComponent({ .line { width: 1px; height: 14px; - background: #B9CFE6; + background: #b9cfe6; } .mulan { -- Gitee From b75c195c900f6f6b1fdbbf005e91d09eefbe41db Mon Sep 17 00:00:00 2001 From: cae545e5 <1876869218@qq.com> Date: Wed, 16 Apr 2025 14:23:55 +0800 Subject: [PATCH 06/75] =?UTF-8?q?feat:=20=E5=AE=9E=E7=8E=B0=E5=BA=95?= =?UTF-8?q?=E9=83=A8=E5=AF=BC=E8=88=AA=E6=96=87=E6=9C=AC=E5=9B=BD=E9=99=85?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/src/locales/index.ts | 4 ++-- ui/src/views/nav/bottom.vue | 10 ++++------ ui/src/views/nav/bottom2.vue | 8 ++++---- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/ui/src/locales/index.ts b/ui/src/locales/index.ts index 30e759466..6d42cce34 100644 --- a/ui/src/locales/index.ts +++ b/ui/src/locales/index.ts @@ -6,7 +6,7 @@ const messages = { logout: '退出', language: '语言设置', }, - bottom2: { + bottom: { project: '木兰社区孵化项目', about: '关于建木', manual: '使用手册', @@ -19,7 +19,7 @@ const messages = { logout: 'Logout', language: 'Language', }, - bottom2: { + bottom: { project: 'Mulan Incubator', about: 'About Jianmu', manual: 'Documentation', diff --git a/ui/src/views/nav/bottom.vue b/ui/src/views/nav/bottom.vue index 9e4c67836..37114caa3 100644 --- a/ui/src/views/nav/bottom.vue +++ b/ui/src/views/nav/bottom.vue @@ -1,12 +1,10 @@ diff --git a/ui/src/views/nav/bottom2.vue b/ui/src/views/nav/bottom2.vue index 8abfdd02a..be4c003b0 100644 --- a/ui/src/views/nav/bottom2.vue +++ b/ui/src/views/nav/bottom2.vue @@ -1,12 +1,12 @@ -- Gitee From 033e40363c7bbd6bb5ded0a08e20989f0b7e88a1 Mon Sep 17 00:00:00 2001 From: cae545e5 <1876869218@qq.com> Date: Wed, 16 Apr 2025 14:32:07 +0800 Subject: [PATCH 07/75] =?UTF-8?q?feat:=20=E5=AE=9E=E7=8E=B0dialog.vue?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E5=9B=BD=E9=99=85=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/src/locales/index.ts | 6 ++++++ ui/src/views/login/dialog.vue | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ui/src/locales/index.ts b/ui/src/locales/index.ts index 6d42cce34..5232ffa09 100644 --- a/ui/src/locales/index.ts +++ b/ui/src/locales/index.ts @@ -12,6 +12,9 @@ const messages = { manual: '使用手册', contact: '联系我们', }, + dialog: { + needLoginTip: '未登录状态下,操作内容将会丢失', + }, }, en: { @@ -25,6 +28,9 @@ const messages = { manual: 'Documentation', contact: 'Contact Us', }, + dialog: { + needLoginTip: 'The contents of the operation will be lost if you are not logged in', + }, }, }; diff --git a/ui/src/views/login/dialog.vue b/ui/src/views/login/dialog.vue index faee426f3..b57299459 100644 --- a/ui/src/views/login/dialog.vue +++ b/ui/src/views/login/dialog.vue @@ -2,7 +2,7 @@
- +
-- Gitee From e3b3b2e8d1f80f1aca29746b2cb307765a4d14e7 Mon Sep 17 00:00:00 2001 From: cae545e5 <1876869218@qq.com> Date: Wed, 16 Apr 2025 16:01:51 +0800 Subject: [PATCH 08/75] =?UTF-8?q?feat:=20=E5=AE=9E=E7=8E=B0all-project.vue?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E5=9B=BD=E9=99=85=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/src/locales/index.ts | 16 ++++++++++++++++ ui/src/views/index/all-project.vue | 24 +++++++++++++++--------- 2 files changed, 31 insertions(+), 9 deletions(-) diff --git a/ui/src/locales/index.ts b/ui/src/locales/index.ts index 5232ffa09..91eb620e6 100644 --- a/ui/src/locales/index.ts +++ b/ui/src/locales/index.ts @@ -15,6 +15,14 @@ const messages = { dialog: { needLoginTip: '未登录状态下,操作内容将会丢失', }, + allProject: { + projectList: '项目列表', + inputPlaceholder: '请输入项目名称', + empty: '暂无项目', + default: '默认排序', + lastExecute: '最近触发', + lastModify: '最近修改', + }, }, en: { @@ -31,6 +39,14 @@ const messages = { dialog: { needLoginTip: 'The contents of the operation will be lost if you are not logged in', }, + allProject: { + projectList: 'Project List', + inputPlaceholder: 'Please enter project name', + empty: 'No Projects', + default: 'Default Sort', + lastExecute: 'Recently triggered', + lastModify: 'Recent changes', + }, }, }; diff --git a/ui/src/views/index/all-project.vue b/ui/src/views/index/all-project.vue index 87af575f4..c5ea54f1c 100644 --- a/ui/src/views/index/all-project.vue +++ b/ui/src/views/index/all-project.vue @@ -3,7 +3,7 @@
-
项目列表
+
{{ $t('allProject.projectList') }}
@@ -31,7 +31,7 @@ />
- +
@@ -47,11 +47,12 @@ import { onBeforeRouteLeave, useRouter } from 'vue-router'; import { namespace } from '@/store/modules/project'; import { createNamespacedHelpers, useStore } from 'vuex'; import { SortTypeEnum } from '@/api/dto/enumeration'; - +import { useI18n } from 'vue-i18n'; const { mapMutations } = createNamespacedHelpers(namespace); export default defineComponent({ components: { ProjectGroup }, setup() { + const { t } = useI18n(); const { proxy } = getCurrentInstance() as any; const router = useRouter(); const store = useStore(); @@ -66,10 +67,10 @@ export default defineComponent({ // 改变项目组排序后强制数据及时刷新 const groupListRefresh = ref(true); // 项目组排序类型 - const sortTypeList = ref>([ - { label: '默认排序', value: SortTypeEnum.DEFAULT_SORT }, - { label: '最近触发', value: SortTypeEnum.LAST_EXECUTION_TIME }, - { label: '最近修改', value: SortTypeEnum.LAST_MODIFIED_TIME }, + const sortTypeList = computed>(() => [ + { label: t('allProject.default'), value: SortTypeEnum.DEFAULT_SORT }, + { label: t('allProject.lastExecute'), value: SortTypeEnum.LAST_EXECUTION_TIME }, + { label: t('allProject.lastModify'), value: SortTypeEnum.LAST_MODIFIED_TIME }, ]); // 所有项目组在vuex中保存的排序类型 const sortType = computed(() => store.state[namespace].sortType); @@ -115,6 +116,7 @@ export default defineComponent({ }); return { + t, projectGroups, projectName, searchProject, @@ -131,6 +133,10 @@ export default defineComponent({ \ No newline at end of file + -- Gitee From 34cea8d5b91b6ef6a9cbba39e53b6e9fe760501e Mon Sep 17 00:00:00 2001 From: cae545e5 <1876869218@qq.com> Date: Mon, 21 Apr 2025 10:04:02 +0800 Subject: [PATCH 39/75] =?UTF-8?q?feat:=20=E5=AE=9E=E7=8E=B0login.vue?= =?UTF-8?q?=E5=9B=BD=E9=99=85=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/src/locales/index.ts | 30 ++++++++++++++++++++++++++++++ ui/src/views/common/login.vue | 29 +++++++++++++++++------------ 2 files changed, 47 insertions(+), 12 deletions(-) diff --git a/ui/src/locales/index.ts b/ui/src/locales/index.ts index d14a2dd9a..701ab5020 100644 --- a/ui/src/locales/index.ts +++ b/ui/src/locales/index.ts @@ -357,6 +357,21 @@ const messages = { browserVersion: '浏览器版本', network: '网络', }, + login: { + welcome: '欢迎登录', + usernamePlaceholder: '请输入用户名', + passwordPlaceholder: '请输入密码', + remember: '记住用户名', + login: '登录', + loginProblem: '登录遇到问题,请尝试重新登录', + cancel: '取消', + reLogin: '重新登录', + loggingInWith: '{type} 账号登录中…', + loginWith: '使用 {type} 账号登录', + usernameEmpty: '用户名不能为空', + passwordEmpty: '密码不能为空', + success: '登录成功', + }, }, en: { @@ -712,6 +727,21 @@ const messages = { browserVersion: 'Browser Version', network: 'Web', }, + login: { + welcome: 'Welcome to login', + usernamePlaceholder: 'Please enter your username', + passwordPlaceholder: 'Please enter your password', + remember: 'Remember username', + login: 'Login', + loginProblem: 'Problems logging in, please try to log in again', + cancel: 'Cancel', + reLogin: 'Re-login', + loggingInWith: 'Account login in progress with {type}…', + loginWith: 'Use {type} account to login', + usernameEmpty: 'Username can\'t be empty', + passwordEmpty: 'Password can\'t be empty', + success: 'Login successful', + }, }, }; diff --git a/ui/src/views/common/login.vue b/ui/src/views/common/login.vue index ec59ef05a..d838f3112 100644 --- a/ui/src/views/common/login.vue +++ b/ui/src/views/common/login.vue @@ -2,7 +2,7 @@
@@ -57,7 +57,9 @@
- {{ loading ? `${Type} 账号登录中…` : `使用 ${Type} 账号登录` }} + {{ + loading ? t('login.loggingInWith', { type: Type }) : t('login.loginWith', { type: Type }) + }}
@@ -71,6 +73,7 @@ import { useRoute, useRouter } from 'vue-router'; import { AUTHORIZE_INDEX, PLATFORM_INDEX } from '@/router/path-def'; import { fetchAuthUrl } from '@/api/session'; import { getRedirectUri } from '@/utils/redirect-uri'; +import { useLocale } from '@/utils/i18n'; const { mapActions: mapSessionActions, mapMutations } = createNamespacedHelpers(namespace); @@ -87,6 +90,7 @@ export default defineComponent({ }, }, setup(props: any, { emit }) { + const { t } = useLocale(); const { proxy } = getCurrentInstance() as any; const router = useRouter(); const route = useRoute(); @@ -149,7 +153,7 @@ export default defineComponent({ // 登录成功 loading.value = false; authError.value = false; - proxy.$success('登录成功'); + proxy.$success(t('login.success')); setTimeout(() => { emit('logined'); }, 500); @@ -210,6 +214,7 @@ export default defineComponent({ window.onstorage = null; }); return { + t, authError, loginType, Type, @@ -218,8 +223,8 @@ export default defineComponent({ loginFormRef, loginForm, loginRule: ref>({ - username: [{ required: true, message: '用户名不能为空', trigger: 'blur' }], - password: [{ required: true, message: '密码不能为空', trigger: 'blur' }], + username: [{ required: true, message: t('login.usernameEmpty'), trigger: 'blur' }], + password: [{ required: true, message: t('login.passwordEmpty'), trigger: 'blur' }], }), login: () => { // 开启loading -- Gitee From a52eb00d7408b6335de7cd64bde2b43d4640fea0 Mon Sep 17 00:00:00 2001 From: cae545e5 <1876869218@qq.com> Date: Mon, 21 Apr 2025 10:33:58 +0800 Subject: [PATCH 40/75] =?UTF-8?q?feat:=20=E5=AE=9E=E7=8E=B0project-group.v?= =?UTF-8?q?ue=E5=9B=BD=E9=99=85=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/src/locales/index.ts | 12 ++++++++++++ ui/src/views/common/project-group.vue | 14 ++++++++++---- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/ui/src/locales/index.ts b/ui/src/locales/index.ts index 701ab5020..fd69d1226 100644 --- a/ui/src/locales/index.ts +++ b/ui/src/locales/index.ts @@ -372,6 +372,12 @@ const messages = { passwordEmpty: '密码不能为空', success: '登录成功', }, + projectGroup: { + viewMore: '查看更多', + noProjects: '没有项目', + noResult: '没有找到相关结果', + totalProjects: '共有 { count } 个项目', + }, }, en: { @@ -742,6 +748,12 @@ const messages = { passwordEmpty: 'Password can\'t be empty', success: 'Login successful', }, + projectGroup: { + viewMore: 'View More', + noProjects: 'No Projects', + noResult: 'No related results were found', + totalProjects: '(Total { count } projects)', + }, }, }; diff --git a/ui/src/views/common/project-group.vue b/ui/src/views/common/project-group.vue index 2245fbb6d..fa0d3d0de 100644 --- a/ui/src/views/common/project-group.vue +++ b/ui/src/views/common/project-group.vue @@ -16,11 +16,13 @@ {{ projectGroup?.name }} - (共有 {{ projectPage.total >= 0 ? projectPage.total : 0 }} 个项目) + {{ + $t('projectGroup.totalProjects', { count: projectPage.total >= 0 ? projectPage.total : 0 }) + }}
- 查看更多 + {{ $t('projectGroup.viewMore') }}
@@ -29,10 +31,14 @@ - \ No newline at end of file + diff --git a/ui/src/locales/index.ts b/ui/src/locales/index.ts index 401f54f76..42af6907e 100644 --- a/ui/src/locales/index.ts +++ b/ui/src/locales/index.ts @@ -737,6 +737,13 @@ const messages = { download: '下载', moreLog: '日志过大,更多日志请下载查看', }, + textCopy: { + copy: '复制', + valueEmpty: '值为空', + copied: '已复制', + copyFailed: '复制失败', + cause: '原因:', + }, }, en: { @@ -1474,6 +1481,13 @@ const messages = { download: 'Download', moreLog: 'log is too large, more logs please download to view', }, + textCopy: { + copy: 'Copy', + valueEmpty: 'value is null', + copied: 'copied', + copyFailed: 'copy failed', + cause: 'cause: ', + }, }, }; -- Gitee From 13dd0c09f1829b7c8b48c98d7eac65f6d910ff80 Mon Sep 17 00:00:00 2001 From: cae545e5 <1876869218@qq.com> Date: Wed, 23 Apr 2025 17:20:28 +0800 Subject: [PATCH 75/75] =?UTF-8?q?feat:=20=E7=9B=91=E5=90=AC=E8=AF=AD?= =?UTF-8?q?=E8=A8=80=E7=B1=BB=E5=9E=8B=E5=8F=98=E5=8C=96=E5=88=B7=E6=96=B0?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2,=E7=94=A8=E6=9D=A5=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E9=9D=A2=E5=8C=85=E5=B1=91=E4=B8=8D=E9=9A=8F=E7=9D=80=E8=AF=AD?= =?UTF-8?q?=E8=A8=80=E5=88=87=E6=8D=A2=E6=94=B9=E5=8F=98=E6=96=87=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/src/views/nav/top.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ui/src/views/nav/top.vue b/ui/src/views/nav/top.vue index 6d33f0d74..566c9a925 100644 --- a/ui/src/views/nav/top.vue +++ b/ui/src/views/nav/top.vue @@ -79,7 +79,7 @@