feat: i18n achievement UI labels and data layer title/description

This commit is contained in:
2026-06-10 16:36:24 +08:00
parent e51b5e234e
commit 2f9f9a4117
10 changed files with 66 additions and 7 deletions

View File

@@ -1,5 +1,8 @@
<script setup lang="ts">
import type { AchievementDef } from '@engine/types'
import { useI18n } from '@/composables/useI18n'
const { t } = useI18n()
defineProps<{
definitions: AchievementDef[]
@@ -14,7 +17,7 @@ const emit = defineEmits<{
<template>
<div class="ach-overlay" @click.self="emit('close')" @keydown.escape="emit('close')">
<div class="ach-panel">
<h2 class="ach-title">成就</h2>
<h2 class="ach-title">{{ t('ui.achievements') }}</h2>
<div class="ach-list">
<div
@@ -29,16 +32,16 @@ const emit = defineEmits<{
</div>
<div class="ach-body">
<div class="ach-title-text">
{{ !unlockedIds.has(ach.id) && ach.hidden ? '???' : ach.title }}
{{ !unlockedIds.has(ach.id) && ach.hidden ? '???' : t(ach.titleKey || ach.title) }}
</div>
<div class="ach-desc-text">
{{ !unlockedIds.has(ach.id) && ach.hidden ? '' : ach.description }}
{{ !unlockedIds.has(ach.id) && ach.hidden ? '' : t(ach.descKey || ach.description) }}
</div>
</div>
</div>
</div>
<button class="ach-close" @click="emit('close')">关闭</button>
<button class="ach-close" @click="emit('close')">{{ t('ui.close') }}</button>
</div>
</div>
</template>