Browse Source

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>
pull/7143/head
programmer 2 weeks ago
committed by GitHub
parent
commit
6a9012e5e4
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 4
      packages/effects/common-ui/src/ui/profile/base-setting.vue
  2. 5
      packages/effects/common-ui/src/ui/profile/password-setting.vue
  3. 4
      packages/locales/src/langs/en-US/profile.json
  4. 4
      packages/locales/src/langs/zh-CN/profile.json

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

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

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

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

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

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