Add 7-language localisation support (de, fr, pl, tr, zh-CN, zh-TW) #13

Manually merged
github merged 1 commit from gh-pr/13/head into gh-pr/13/base 2026-12-05 17:21:47 +00:00
Owner

@⁠H-Bole on GitHub · 2026-12-05 14:03 UTC · original
H-Bole:feat/i18n → main · +3266 −124 · 31 files · 1 commits · merged 2026-12-05 14:51 UTC

Summary

Adds full multi-language localisation support across larp-core, larp-gpu, larp-game, larp-hle, and pps/larp, supporting 7 languages out of the box:

  • English (en)
  • Deutsch (de)
  • Français ( r)
  • Polski (pl)
  • Türkçe ( r)
  • 简体中文 (zh-CN)
  • 繁體中文 (zh-TW)

Key Changes

  • Zero-dependency compile-time locale bundling & runtime i18n (larp-core):
    • Added crates/larp-core/build.rs with a minimal strict JSON parser using only std (no new external crates or Cargo.lock dependency additions) to validate and embed locales/*.json at compile time.
    • Added crates/larp-core/src/i18n.rs with priority --lang > LARP_LANGUAGE > OS UI language (GetUserPreferredUILanguages on Windows, LC_ALL/LC_MESSAGES/LANG elsewhere), runtime switching via set_language(), and CJK/full-width display_width() calculation.
  • Unicode & CJK Overlay Rendering (larp-gpu):
    • Extended crates/larp-gpu/src/overlay/font.rs with cached Windows GDI glyph rasterisation (
      asterize_unicode) for non-ASCII European Latin and CJK characters (Microsoft YaHei UI / Microsoft JhengHei UI / Consolas).
    • Updated crates/larp-gpu/src/overlay.rs to advance column positions by character display width.
  • UI, Settings Menu & CLI Integration:
    • Added a live Language option in the F10 settings menu (Picture page) while keeping settings.ini keys and persisted values in English.
    • Localised all 75 setting labels/descriptions, F9 performance overlay labels/memory pool names, pipeline compilation progress bar, GPU status lines, startup hardware advisor, and larp config output.

Precompiled Binary

Verification

  • cargo test -p larp-core: 7/7 tests passed (tag normalisation, priority/auto fallback, template formatting, display width, and 100% key/placeholder completeness across all 7 languages).
  • cargo build --release -p larp: succeeded.
  • larp.exe config verified with LARP_LANGUAGE=en|de|fr|pl|tr|zh-CN|zh-TW.
**@⁠H-Bole** on GitHub · 2026-12-05 14:03 UTC · [original](https://github.com/gamingwithhomie/larp/pull/13) `H-Bole:feat/i18n` → `main` · +3266 −124 · 31 files · 1 commits · merged 2026-12-05 14:51 UTC ## Summary Adds full multi-language localisation support across larp-core, larp-gpu, larp-game, larp-hle, and pps/larp, supporting **7 languages** out of the box: - English (en) - Deutsch (de) - Français ( r) - Polski (pl) - Türkçe ( r) - 简体中文 (zh-CN) - 繁體中文 (zh-TW) ## Key Changes - **Zero-dependency compile-time locale bundling & runtime i18n (larp-core)**: - Added crates/larp-core/build.rs with a minimal strict JSON parser using only std (no new external crates or Cargo.lock dependency additions) to validate and embed locales/*.json at compile time. - Added crates/larp-core/src/i18n.rs with priority --lang > LARP_LANGUAGE > OS UI language (GetUserPreferredUILanguages on Windows, LC_ALL/LC_MESSAGES/LANG elsewhere), runtime switching via set_language(), and CJK/full-width display_width() calculation. - **Unicode & CJK Overlay Rendering (larp-gpu)**: - Extended crates/larp-gpu/src/overlay/font.rs with cached Windows GDI glyph rasterisation ( asterize_unicode) for non-ASCII European Latin and CJK characters (Microsoft YaHei UI / Microsoft JhengHei UI / Consolas). - Updated crates/larp-gpu/src/overlay.rs to advance column positions by character display width. - **UI, Settings Menu & CLI Integration**: - Added a live Language option in the F10 settings menu (Picture page) while keeping settings.ini keys and persisted values in English. - Localised all 75 setting labels/descriptions, F9 performance overlay labels/memory pool names, pipeline compilation progress bar, GPU status lines, startup hardware advisor, and larp config output. ## Precompiled Binary - A precompiled larp.exe from this fork branch is attached to the fork release: https://github.com/H-Bole/larp/releases/tag/v2026.12.05-i18n ## Verification - cargo test -p larp-core: 7/7 tests passed (tag normalisation, priority/auto fallback, template formatting, display width, and 100% key/placeholder completeness across all 7 languages). - cargo build --release -p larp: succeeded. - larp.exe config verified with LARP_LANGUAGE=en|de|fr|pl|tr|zh-CN|zh-TW.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-05 17:21:45 +00:00
github manually merged commit 2d661c8171 into gh-pr/13/base 2026-12-05 17:21:47 +00:00
Author
Owner

@⁠copilot-pull-request-reviewer[bot] on GitHub · 2026-12-05 14:03 UTC · original · reviewed

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

**@⁠copilot-pull-request-reviewer[bot]** on GitHub · 2026-12-05 14:03 UTC · [original](https://github.com/gamingwithhomie/larp/pull/13#pullrequestreview-6203508824) · **reviewed** Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
Author
Owner

@⁠fantasyplus on GitHub · 2026-12-05 15:22 UTC · original

实时更新呀:)

**@⁠fantasyplus** on GitHub · 2026-12-05 15:22 UTC · [original](https://github.com/gamingwithhomie/larp/pull/13#issuecomment-7440364368) 实时更新呀:)
This discussion has been locked. Commenting is limited to contributors.
No description provided.