Skip to content

feat: 支持 mod 名称/描述/作者/章节名多语言本地化#8

Open
ZhaoWeicheng98 wants to merge 1 commit intoIrisuM:masterfrom
AsaChiri:feat/localized-mod-metadata
Open

feat: 支持 mod 名称/描述/作者/章节名多语言本地化#8
ZhaoWeicheng98 wants to merge 1 commit intoIrisuM:masterfrom
AsaChiri:feat/localized-mod-metadata

Conversation

@ZhaoWeicheng98
Copy link
Copy Markdown
Contributor

@ZhaoWeicheng98 ZhaoWeicheng98 commented Mar 31, 2026

Summary

  • ModDescription.Name/Description/Authorstring 改为 LocalizedStringChapterNamesDictionary<string, string> 改为 Dictionary<string, LocalizedString>
  • 添加 LocalizedStringConverter 自定义 JSON 转换器,同时支持纯字符串(向后兼容,视为 zh-Hans)和标准 { "ja": "...", "zh-Hans": "..." } 对象格式
  • 添加 schema 迁移 2.1 → 2.2,自动将旧格式 info.json 中的纯字符串字段转为 LocalizedString 对象
  • 语言切换时自动释放并重新生成 mod 选择菜单脚本,确保 mod 名称等随语言切换即时更新

Test plan

  • 加载旧格式(schema 2.1)mod,验证纯字符串 Name/Description/Author 正常反序列化和显示
  • 接受迁移弹窗后,验证 info.json 被正确转为 2.2 格式并备份为 info.2.1.json
  • 加载新格式(schema 2.2)mod,验证 jazh-Hans 值根据游戏语言正确显示
  • 在标题画面切换语言后返回 mod 选择菜单,验证 mod 名称/描述/作者即时更新
  • 验证存档画面的自定义章节名随语言切换正确显示

🤖 Generated with Claude Code

将 ModDescription.Name/Description/Author 从 string 改为 LocalizedString,
ChapterNames 从 Dictionary<string, string> 改为 Dictionary<string, LocalizedString>。

- 添加 LocalizedStringConverter 支持 JSON 纯字符串向后兼容(视为 zh-Hans)
- 添加 LocalizedStringDictionaryConverter 处理 ChapterNames 混合格式
- 添加 schema 迁移 2.1 → 2.2 自动转换旧格式
- 语言切换时自动重新生成 mod 选择菜单脚本

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ZhaoWeicheng98 ZhaoWeicheng98 force-pushed the feat/localized-mod-metadata branch from 7b8c927 to 7b021a1 Compare March 31, 2026 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant