feat(i18n): 添加通知模块的本地化支持,包括标题、详情和加载状态等翻译
This commit is contained in:
@@ -147,6 +147,13 @@
|
|||||||
"support": "支持主流银行快速充值提现"
|
"support": "支持主流银行快速充值提现"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"notify": {
|
||||||
|
"title": "通知",
|
||||||
|
"detail": "详情",
|
||||||
|
"markAllRead": "全部已读",
|
||||||
|
"markAllReadSuccess": "全部已读",
|
||||||
|
"loading": "加载中..."
|
||||||
|
},
|
||||||
"trade": {
|
"trade": {
|
||||||
"title": "交易",
|
"title": "交易",
|
||||||
"spot": "现货",
|
"spot": "现货",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { client, safeClient } from "@/api";
|
|||||||
import { NotificationTypeIcon } from "./enum";
|
import { NotificationTypeIcon } from "./enum";
|
||||||
|
|
||||||
const props = defineProps<{ id: string }>();
|
const props = defineProps<{ id: string }>();
|
||||||
|
const { t } = useI18n();
|
||||||
const { data } = await safeClient(client.api.notifications({ id: props.id }).get());
|
const { data } = await safeClient(client.api.notifications({ id: props.id }).get());
|
||||||
|
|
||||||
function getConfigByType(type: string) {
|
function getConfigByType(type: string) {
|
||||||
@@ -16,7 +16,7 @@ function getConfigByType(type: string) {
|
|||||||
<IonHeader class="ion-no-border">
|
<IonHeader class="ion-no-border">
|
||||||
<ion-toolbar class="ion-toolbar">
|
<ion-toolbar class="ion-toolbar">
|
||||||
<ui-back-button slot="start" />
|
<ui-back-button slot="start" />
|
||||||
<ion-title>通知详情</ion-title>
|
<ion-title>{{ t('notify.detail') }}</ion-title>
|
||||||
</ion-toolbar>
|
</ion-toolbar>
|
||||||
</IonHeader>
|
</IonHeader>
|
||||||
<IonContent :fullscreen="true" class="ion-padding">
|
<IonContent :fullscreen="true" class="ion-padding">
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import MaterialSymbolsAndroidContacts from "~icons/material-symbols/android-cont
|
|||||||
import { client, safeClient } from "@/api";
|
import { client, safeClient } from "@/api";
|
||||||
import { NotificationTypeIcon } from "./enum";
|
import { NotificationTypeIcon } from "./enum";
|
||||||
|
|
||||||
|
const { t } = useI18n();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const [query] = useResetRef<NotificationBody>({
|
const [query] = useResetRef<NotificationBody>({
|
||||||
limit: 20,
|
limit: 20,
|
||||||
@@ -58,7 +59,7 @@ async function handleAllRead() {
|
|||||||
ids: [],
|
ids: [],
|
||||||
}));
|
}));
|
||||||
const toast = await toastController.create({
|
const toast = await toastController.create({
|
||||||
message: "所有通知已标记为已读",
|
message: t("notify.markAllReadSuccess"),
|
||||||
duration: 2000,
|
duration: 2000,
|
||||||
position: "bottom",
|
position: "bottom",
|
||||||
color: "success",
|
color: "success",
|
||||||
@@ -87,7 +88,7 @@ onBeforeMount(() => {
|
|||||||
<!-- <ion-button slot="end" fill="clear">
|
<!-- <ion-button slot="end" fill="clear">
|
||||||
<MaterialSymbolsAndroidContacts slot="icon-only" />
|
<MaterialSymbolsAndroidContacts slot="icon-only" />
|
||||||
</ion-button> -->
|
</ion-button> -->
|
||||||
<ion-title>通知</ion-title>
|
<ion-title>{{ t('notify.title') }}</ion-title>
|
||||||
</ion-toolbar>
|
</ion-toolbar>
|
||||||
</IonHeader>
|
</IonHeader>
|
||||||
<IonContent :fullscreen="true">
|
<IonContent :fullscreen="true">
|
||||||
@@ -127,7 +128,7 @@ onBeforeMount(() => {
|
|||||||
<ion-infinite-scroll threshold="100px" @ion-infinite="handleInfinite">
|
<ion-infinite-scroll threshold="100px" @ion-infinite="handleInfinite">
|
||||||
<ion-infinite-scroll-content
|
<ion-infinite-scroll-content
|
||||||
loading-spinner="bubbles"
|
loading-spinner="bubbles"
|
||||||
loading-text="加载中..."
|
:loading-text="t('notify.loading')"
|
||||||
/>
|
/>
|
||||||
</ion-infinite-scroll>
|
</ion-infinite-scroll>
|
||||||
</IonContent>
|
</IonContent>
|
||||||
|
|||||||
Reference in New Issue
Block a user