feat(i18n): 管理端与玩家端三语支持(中/英/马来语)

- 管理后台 adminT 文案库、结算与代理端页面、表单校验
- 玩家端 vue-i18n 补全首页/公告/串关与 ms 文案
- Element Plus ms 语言包与共享 locale 工具
This commit is contained in:
2026-06-03 15:05:36 +08:00
parent 80adc0e928
commit cbfa18d1d3
63 changed files with 3081 additions and 1038 deletions

View File

@@ -1,6 +1,9 @@
<script setup lang="ts">
import { ref, onMounted, onUnmounted, watch } from 'vue';
import { useRouter } from 'vue-router';
import { useI18n } from 'vue-i18n';
const { t } = useI18n();
import defaultBannerImg from '../assets/images/banner.png';
export interface BannerItem {
@@ -31,7 +34,7 @@ function onImgError(e: Event) {
}
function title(banner: BannerItem) {
return banner.translation?.title || 'Banner';
return banner.translation?.title || t('home.banner_fallback');
}
function goTo(index: number) {
@@ -130,8 +133,8 @@ onUnmounted(stopAutoPlay);
</div>
</div>
<button v-if="banners.length > 1" class="nav prev" type="button" aria-label="上一张" @click.stop="prev"></button>
<button v-if="banners.length > 1" class="nav next" type="button" aria-label="下一张" @click.stop="next"></button>
<button v-if="banners.length > 1" class="nav prev" type="button" :aria-label="t('home.banner_prev')" @click.stop="prev"></button>
<button v-if="banners.length > 1" class="nav next" type="button" :aria-label="t('home.banner_next')" @click.stop="next"></button>
<div v-if="banners.length > 1" class="dots">
<button
@@ -140,7 +143,7 @@ onUnmounted(stopAutoPlay);
type="button"
class="dot"
:class="{ active: i === active }"
:aria-label="` ${i + 1} `"
:aria-label="t('home.banner_slide', { n: i + 1 })"
@click.stop="goTo(i)"
/>
</div>