Explorar el Código

chore: 给个人中心的2个按钮加上 i18n (#7138)

* fix: 个人中心按钮i18n

* fix: eslint format

* fix: 调整label宽度让英文显示在一行

* chore: 调整label小点

* fix: import

---------

Co-authored-by: Jin Mao <50581550+jinmao88@users.noreply.github.com>
programmer hace 4 meses
padre
commit
6a9012e5e4

+ 3 - 1
packages/effects/common-ui/src/ui/profile/base-setting.vue

@@ -5,6 +5,8 @@ import type { VbenFormSchema } from '@vben-core/form-ui';
 
 import { computed, reactive } from 'vue';
 
+import { $t } from '@vben/locales';
+
 import { useVbenForm } from '@vben-core/form-ui';
 import { VbenButton } from '@vben-core/shadcn-ui';
 
@@ -50,7 +52,7 @@ defineExpose({
   <div @keydown.enter.prevent="handleSubmit">
     <Form />
     <VbenButton type="submit" class="mt-4" @click="handleSubmit">
-      更新基本信息
+      {{ $t('profile.updateBasicProfile') }}
     </VbenButton>
   </div>
 </template>

+ 4 - 1
packages/effects/common-ui/src/ui/profile/password-setting.vue

@@ -5,6 +5,8 @@ import type { VbenFormSchema } from '@vben-core/form-ui';
 
 import { computed, reactive } from 'vue';
 
+import { $t } from '@vben/locales';
+
 import { useVbenForm } from '@vben-core/form-ui';
 import { VbenButton } from '@vben-core/shadcn-ui';
 
@@ -23,6 +25,7 @@ const emit = defineEmits<{
 const [Form, formApi] = useVbenForm(
   reactive({
     commonConfig: {
+      labelWidth: 130,
       // 所有表单项
       componentProps: {
         class: 'w-full',
@@ -50,7 +53,7 @@ defineExpose({
   <div>
     <Form />
     <VbenButton type="submit" class="mt-4" @click="handleSubmit">
-      更新密码
+      {{ $t('profile.updatePassword') }}
     </VbenButton>
   </div>
 </template>

+ 4 - 0
packages/locales/src/langs/en-US/profile.json

@@ -0,0 +1,4 @@
+{
+  "updatePassword": "Update Password",
+  "updateBasicProfile": "Update Basic Profile"
+}

+ 4 - 0
packages/locales/src/langs/zh-CN/profile.json

@@ -0,0 +1,4 @@
+{
+  "updatePassword": "更新密码",
+  "updateBasicProfile": "更新基本信息"
+}