From 3d9785fdf22ba7639372e2430a95e6440f61cf6a Mon Sep 17 00:00:00 2001 From: Seven Date: Sat, 20 Dec 2025 05:30:59 +0700 Subject: [PATCH] Refactor and enhance localization support; update language files and improve validation messages - Updated localization files for Arabic and Traditional Chinese (Hong Kong). - Added Arabic language support in the i18n configuration. - Improved validation messages in the withdrawal schema. - Refactored Vue components to ensure consistent usage of translation functions. - Cleaned up CSS files for better formatting and consistency. --- .github/copilot-instructions.md | 1 - cypress.config.ts | 2 +- src/auth/components/login/email/step1.vue | 6 +- src/auth/components/login/email/step2.vue | 8 +- src/auth/components/signup/email/step1.vue | 22 +- src/auth/components/signup/email/step2.vue | 7 +- .../components/signup/verification-code.vue | 4 +- src/components/ui/collapse/exports.ts | 4 +- src/composables/useLanguage.ts | 10 + src/locales/ar.json | 325 ++++++++++++++++++ src/locales/index.ts | 6 +- src/locales/zh-HK.json | 325 ++++++++++++++++++ src/theme/index.css | 2 +- src/theme/ionic.css | 4 +- src/theme/variables.css | 14 +- src/views/withdraw/rules.ts | 30 +- 16 files changed, 719 insertions(+), 51 deletions(-) create mode 100644 src/locales/ar.json create mode 100644 src/locales/zh-HK.json diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 5367796..24efe78 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -1,4 +1,3 @@ - Riwa-Ionic 项目提示词 你是一个专业的移动应用开发助手,负责协助开发基于 Ionic + Vue 3 + TypeScript + Capacitor 的跨平台移动应用项目。 diff --git a/cypress.config.ts b/cypress.config.ts index 7c51293..42765ed 100644 --- a/cypress.config.ts +++ b/cypress.config.ts @@ -7,7 +7,7 @@ export default defineConfig({ videosFolder: "tests/e2e/videos", screenshotsFolder: "tests/e2e/screenshots", baseUrl: "http://localhost:5173", - // eslint-disable-next-line unused-imports/no-unused-vars + setupNodeEvents(on, config) { // implement node event listeners here }, diff --git a/src/auth/components/login/email/step1.vue b/src/auth/components/login/email/step1.vue index f303192..7c3dd65 100644 --- a/src/auth/components/login/email/step1.vue +++ b/src/auth/components/login/email/step1.vue @@ -4,12 +4,12 @@ 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; }>(); +const { t } = useI18n(); + const model = defineModel({ type: String, required: true }); const inputInstance = useTemplateRef("inputInstance"); @@ -48,7 +48,7 @@ async function submitSendVerification() { } else { const toast = await toastController.create({ - message: error?.message || t('auth.common.failedSendCode'), + message: error?.message || t("auth.common.failedSendCode"), duration: 1500, position: "bottom", }); diff --git a/src/auth/components/login/email/step2.vue b/src/auth/components/login/email/step2.vue index 71041fa..67ffe8a 100644 --- a/src/auth/components/login/email/step2.vue +++ b/src/auth/components/login/email/step2.vue @@ -1,20 +1,22 @@