feat: configurable locales path per story, dynamic language switching from story data

This commit is contained in:
2026-06-10 12:17:52 +08:00
parent 4cf2263c78
commit 86a0aebdc8
10 changed files with 64 additions and 28 deletions

View File

@@ -17,7 +17,7 @@ import AccessibilitySettings from '@/components/AccessibilitySettings.vue'
import { useGameEngine } from '@/composables/useGameEngine'
import { useGameStore } from '@/stores/gameStore'
import { useFullscreen } from '@/composables/useFullscreen'
import { useI18n } from '@/composables/useI18n'
import { useI18n, initStoryLocales } from '@/composables/useI18n'
const store = useGameStore()
const { t, currentLang } = useI18n()
@@ -62,6 +62,10 @@ async function resolveScenePath(): Promise<string> {
async function init() {
const scenePath = await resolveScenePath()
await loadGame(scenePath)
const lc = store.storyLocales
if (lc.path) {
await initStoryLocales(lc.path)
}
loading.value = false
hasAutoSave.value = (await saveSystem.load(0)) !== null
}