Skip to content

Add key based localisation with Chinese, Japanese and Korean resources - #2576

Open
isWxiang wants to merge 18 commits into
PathOfBuildingCommunity:devfrom
isWxiang:feature/integrated-localisation
Open

isWxiang wants to merge 18 commits into
PathOfBuildingCommunity:devfrom
isWxiang:feature/integrated-localisation

Conversation

@isWxiang

Copy link
Copy Markdown

Description of the problem being solved:

English text currently serves both as display content and as application identity. This makes adding languages difficult without affecting calculations, parsing, search or saved builds.

This PR introduces explicit semantic message keys: English becomes a resource value, while UI messages and game display fields resolve through a selected language and an English fallback. Original game identities, calculation data, parser input, user text and exported build data remain separate from translated display text.

  • Add persistent language selection, defaulting to English, with Simplified Chinese, Traditional Chinese, Japanese and Korean resources.
  • Bind UI labels, game fields, modifier lines, tooltips and calculation displays to stable keys; refresh display caches when switching language.
  • Add domain specific translated input and search adapters, Unicode text layout/editing, and Noto CJK font assets with their OFL notices. Windows generates the required language atlas on demand instead of shipping every language atlas in advance.
  • Include passive tree drag event positions, cursor anchored zoom, and offscreen drawing fixes as part of the multilingual UI work.
  • Provide complete English and Chinese guides, resource provenance, and regression tools.

Japanese and Korean translations were generated by Codex and have not been manually verified. Each has 123,836 display keys, matching the English catalogue; this establishes structural coverage, not linguistic accuracy. The guides retain the provenance records for existing Chinese dictionaries and source material. Simplified/Traditional Chinese currently have 660/655 keys that fall back to English.

The fork's independent release work is maintained separately. This PR retains the upstream CI workflow.

Steps taken to verify a working solution:

  • Windows test-localisation.cmd: exit 0; 311 reviewed display occurrences, 218 contract assertions, and 423,612 integration assertions, including three offline builds and five language page smoke checks.
  • All five display catalogues pass key and named parameter checks; Japanese/Korean have no missing display keys.
  • Tests/PassiveTreeInteraction.lua: 28 assertions pass for drag, release, focus, zoom and drawing boundaries.
  • Upstream official container: all 52 system spec files pass, with 903 successes and no failures/errors/pending; the corrected item spec was rerun separately (77 cases).
  • ModCache: actual regeneration completes and matches the tracked file byte for byte after adding ./?.lua to LUA_PATH. The exact upstream command fails to load Data.VerisiumCrafts on unmodified upstream dev too; this local path correction avoids counting failed startup as successful regeneration.
  • Three existing system specs now use GetProperty for lazy labels or verify original modifier lines/count/bonded flags alongside added display metadata; original English values and export/persistence assertions are retained.

The container checks run locally in WSL using the upstream test image, not on GitHub hosted Actions. Existing missing tree node warnings remain. Automated checks do not replace manual translation or complete visual validation; the Windows atlas generation path is not a Linux/macOS font implementation.

Link to a build that showcases this PR:

No public showcase build is attached. The reproducible offline builds used by the integration regression are included under src/Tests/Fixtures/poe-ninja, with provenance and source setup in the guides.

Before screenshot:

Not attached.

After screenshot:

Not attached. Japanese/Korean visual verification has not been performed.


中文说明

本 PR 将显示文本与业务身份分离:文本以稳定语义 Key 为标识,英文本身只是资源值。界面及游戏显示字段按语言资源解析,计算、解析、排序、用户文字和构筑导出继续使用原始数据,避免用翻译后的文字作为业务主键。

  • 提供英文、简体中文、繁体中文、日文和韩文五个语言选项;新安装默认英文,语言选择可保存。
  • 将界面、游戏字段、词缀行、提示框和计算详情绑定到 Key,切换语言时刷新显示缓存;补齐分业务域的输入与搜索、Unicode 文本布局和编辑。
  • 随项目提供 Noto CJK 字体及 OFL 声明,Windows 按需生成对应语言图集;包含本次多语言界面工作中的天赋树拖动事件坐标、滚轮锚点缩放及屏幕外绘制修复。
  • 提供按章节组织的完整中英文指南、资源来源记录、回归 fixture 和维护工具。本仓库独立 Release 工作已单独分离,上游 CI 工作流保持现状。

日/韩译文由 Codex 生成,未经人工检验。 每种语言包含 123,836 个显示 Key,与英文一致;结构覆盖不代表译文准确性。既有中文词典与来源资料保留原有溯源记录;简体/繁体仍有 660/655 个 Key 回退英文。

验证:Windows 本地化回归通过(311 个已审阅显示入口、218 项契约断言、423,612 项集成断言);五种语言资源 Key 与命名参数检查无错误;天赋树交互回归 28 项断言通过。上游官方容器逐文件执行 52 个系统测试文件,合计 903 个用例通过(修正后的物品测试另行复跑,77 个用例通过);补充 ./?.lua 搜索路径后实际重生成 ModCache,与 Git 中版本逐字节一致。原始上游命令在未修改的 dev 上同样因缺少该搜索路径而无法加载 Data.VerisiumCrafts。

三处既有测试文件适配控件 GetProperty 和附加显示元数据,保留原有英文值、词缀数量/绑定状态及导出/持久化断言。容器检查使用上游镜像在 WSL 本地执行,不代表 GitHub 托管 CI 已通过。既有 missing-node 警告仍存在;日/韩未人工校对或窗口视觉验收,Windows 字体图集生成也不代表 Linux/macOS 图形界面支持。未附公开演示包或前后窗口截图;离线构筑 fixture 与源码运行方法已随仓库提供。

默认使用 English,新增日语和韩语入口及英文回退;加入 Noto Sans SC/JP/KR 字体与 OFL 许可证,支持按语言加载及缓存图集,并修正发布清单中的字体路径。

保留技能编辑和保存身份,补齐简繁技能描述与提示模板,加入回归测试、来源记录和合并前整理文档。日语和韩语翻译、正式安装器及干净安装验收仍待完成。
原样收录 NotoSansCJKkr-Regular.otf 和压缩包 LICENSE,记录来源及哈希。日文 Noto Sans JP 已在此前提交中,保留现有运行时字体配置。
Replace chronological localisation reports with complete English and Chinese guides covering semantic message keys, display identity boundaries, maintenance, fonts, verification, and upstream review.

Preserve review and provenance inputs unchanged under docs/localisation, and redirect generated audit reports to ignored Tests/Run output.
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