feat: configurable locales path per story, dynamic language switching from story data
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user