feat(i18n): 添加通知模块的本地化支持,包括标题、详情和加载状态等翻译

This commit is contained in:
2026-01-14 03:48:34 +07:00
parent 33391afc0a
commit 1a7f67c584
3 changed files with 13 additions and 5 deletions

View File

@@ -147,6 +147,13 @@
"support": "支持主流银行快速充值提现"
}
},
"notify": {
"title": "通知",
"detail": "详情",
"markAllRead": "全部已读",
"markAllReadSuccess": "全部已读",
"loading": "加载中..."
},
"trade": {
"title": "交易",
"spot": "现货",

View File

@@ -3,7 +3,7 @@ import { client, safeClient } from "@/api";
import { NotificationTypeIcon } from "./enum";
const props = defineProps<{ id: string }>();
const { t } = useI18n();
const { data } = await safeClient(client.api.notifications({ id: props.id }).get());
function getConfigByType(type: string) {
@@ -16,7 +16,7 @@ function getConfigByType(type: string) {
<IonHeader class="ion-no-border">
<ion-toolbar class="ion-toolbar">
<ui-back-button slot="start" />
<ion-title>通知详情</ion-title>
<ion-title>{{ t('notify.detail') }}</ion-title>
</ion-toolbar>
</IonHeader>
<IonContent :fullscreen="true" class="ion-padding">

View File

@@ -8,6 +8,7 @@ import MaterialSymbolsAndroidContacts from "~icons/material-symbols/android-cont
import { client, safeClient } from "@/api";
import { NotificationTypeIcon } from "./enum";
const { t } = useI18n();
const router = useRouter();
const [query] = useResetRef<NotificationBody>({
limit: 20,
@@ -58,7 +59,7 @@ async function handleAllRead() {
ids: [],
}));
const toast = await toastController.create({
message: "所有通知已标记为已读",
message: t("notify.markAllReadSuccess"),
duration: 2000,
position: "bottom",
color: "success",
@@ -87,7 +88,7 @@ onBeforeMount(() => {
<!-- <ion-button slot="end" fill="clear">
<MaterialSymbolsAndroidContacts slot="icon-only" />
</ion-button> -->
<ion-title>通知</ion-title>
<ion-title>{{ t('notify.title') }}</ion-title>
</ion-toolbar>
</IonHeader>
<IonContent :fullscreen="true">
@@ -127,7 +128,7 @@ onBeforeMount(() => {
<ion-infinite-scroll threshold="100px" @ion-infinite="handleInfinite">
<ion-infinite-scroll-content
loading-spinner="bubbles"
loading-text="加载中..."
:loading-text="t('notify.loading')"
/>
</ion-infinite-scroll>
</IonContent>