feat: 添加国际化支持,更新登录和注册组件中的文本,优化用户体验

This commit is contained in:
2025-12-18 22:48:05 +07:00
parent 3b2eb67ad1
commit 8b3fec2376
9 changed files with 112 additions and 28 deletions

View File

@@ -4,6 +4,8 @@ import { toastController } from "@ionic/vue";
import { logoGoogle, phonePortraitOutline } from "ionicons/icons";
import { authClient } from "@/auth";
const { t } = useI18n();
const emit = defineEmits<{
(e: "success", value: string): void;
}>();
@@ -46,7 +48,7 @@ async function submitSendVerification() {
}
else {
const toast = await toastController.create({
message: error?.message || "Failed to send verification code.",
message: error?.message || t('auth.common.failedSendCode'),
duration: 1500,
position: "bottom",
});
@@ -58,29 +60,29 @@ async function submitSendVerification() {
<template>
<h1 class="title">
<strong>Log in</strong>
<strong>{{ t('auth.login.title') }}</strong>
</h1>
<ui-input-label
ref="inputInstance"
v-model="model"
label="Email"
placeholder="Enter your email"
:label="t('auth.common.email')"
:placeholder="t('auth.common.enterEmail')"
type="email"
error-text="Please enter a valid email address."
:error-text="t('auth.common.validEmailError')"
@ion-input="validate($event.target.value as string)"
@ion-blur="markTouched"
/>
<ion-button expand="block" class="ion-margin-top" shape="round" @click="submitSendVerification">
Next
{{ t('auth.common.next') }}
</ion-button>
<ui-divider text="Or continue with" />
<ui-divider :text="t('auth.common.orContinueWith')" />
<ion-button color="medium" expand="block" class="ion-margin-top" shape="round">
<IonIcon slot="start" aria-hidden="true" :icon="logoGoogle" />
Google
{{ t('auth.common.google') }}
</ion-button>
</template>