fix: EN切换失效、删除贡献者描述、版本按演进线分组(2D->3D)

- fix(i18n): composition 模式下响应式 locale 在 i18n.global 上(非 i18n.locale),
  loadLocaleAsync 与 useI18nLazy 改用 i18n.global.locale;
  useI18nLazy.current 改为派生自全局 locale 的 computed(单一数据源);
  各组件 useI18n() 加 useScope:'global' 确保读到同一 composer。
  headless 验证:默认中文(不下载EN chunk)->点EN加载en.[hash].js并切英文->切回中文 全通过
- content: 删除 MobileGame 概览中「主要贡献者 Zikai Wang... Hongxiang He...」句子
- timeline: 版本数据改为多演进线并行(zikai-ui/main/doby/roll-a-ball),
  每线带 2D/3D 形态标记,3D 线前显示「形态转变:2D -> 3D 滚球」转折标记
This commit is contained in:
Zikai
2026-07-12 15:03:04 +00:00
parent 15af291da0
commit e8dee338ed
11 changed files with 273 additions and 105 deletions

View File

@@ -22,9 +22,10 @@ const loadedLocales = new Set(['zh-CN'])
* 之后切换仅在已加载集合内完成(无网络请求)。
*/
export async function loadLocaleAsync(locale) {
if (i18n.locale.value === locale) return
// composition 模式下响应式 locale 在 i18n.global
if (i18n.global.locale.value === locale) return
if (loadedLocales.has(locale)) {
i18n.locale.value = locale
i18n.global.locale.value = locale
document.documentElement.setAttribute('lang', locale)
return
}
@@ -35,14 +36,14 @@ export async function loadLocaleAsync(locale) {
messages = (await import('./locales/en.js')).default
} else {
// 未知语言回退到中文
i18n.locale.value = 'zh-CN'
i18n.global.locale.value = 'zh-CN'
document.documentElement.setAttribute('lang', 'zh-CN')
return
}
i18n.mergeLocaleMessage(locale, messages)
i18n.global.mergeLocaleMessage(locale, messages)
loadedLocales.add(locale)
i18n.locale.value = locale
i18n.global.locale.value = locale
document.documentElement.setAttribute('lang', locale)
}