Localize the F1 menu and fix Chinese text layout #1977

Open
github-bot wants to merge 3 commits from github-bot/gh-1977 into main AGit
Owner

@⁠wrq2007 on GitHub · 2026-11-29 05:27 UTC · original
wrq2007:pr/chinese-menu-localization → main · +633 −258 · 6 files · 3 commits · open

Summary

This PR adds Chinese localization to the Windows F1 settings menu and key-binding screen:

  • Add Chinese rendering for the F1 settings menu and key-binding screen through Windows GDI, with Microsoft YaHei UI, SimSun, and Microsoft JhengHei UI fallbacks.
  • Keep the existing 5x7 renderer for ASCII text and use English strings automatically when Chinese glyphs are unavailable.
  • Add VICTORY_MENU_LANGUAGE=auto|en|zh for an explicit menu language choice.
  • Translate settings, values, actions, help text, notes, and key-binding labels into Chinese, including the latest upstream menu options.
  • Fix the text-box width calculation so Chinese labels do not produce black borders or overflow.
  • Keep VICTORY_IME_ENGLISH as an independent opt-in switch for forcing the English (US) keyboard layout while the game window is focused.

No wave64, BVH, cache, configuration, game asset, or binary changes are included.

Validation

  • cargo test --locked -p victory-gpu host::menu::tests — 10 passed, 0 failed, including explicit language selection and English fallback for 帧生成.
  • cargo test --locked -p victory-gpu — 591 passed, 0 failed, 44 ignored.
  • cargo build --release -p victory --locked — passed.
  • cargo xtask policy --staged — passed.
  • git diff --check

Compatibility

Chinese rendering is selected only when the user allows it and Windows can provide a Chinese glyph; otherwise the existing ASCII English menu remains available. Keyboard layout activation is independent from the menu language and remains opt-in through VICTORY_IME_ENGLISH.

**@⁠wrq2007** on GitHub · 2026-11-29 05:27 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1977) `wrq2007:pr/chinese-menu-localization` → `main` · +633 −258 · 6 files · 3 commits · open ## Summary This PR adds Chinese localization to the Windows F1 settings menu and key-binding screen: - Add Chinese rendering for the F1 settings menu and key-binding screen through Windows GDI, with Microsoft YaHei UI, SimSun, and Microsoft JhengHei UI fallbacks. - Keep the existing 5x7 renderer for ASCII text and use English strings automatically when Chinese glyphs are unavailable. - Add `VICTORY_MENU_LANGUAGE=auto|en|zh` for an explicit menu language choice. - Translate settings, values, actions, help text, notes, and key-binding labels into Chinese, including the latest upstream menu options. - Fix the text-box width calculation so Chinese labels do not produce black borders or overflow. - Keep `VICTORY_IME_ENGLISH` as an independent opt-in switch for forcing the English (US) keyboard layout while the game window is focused. No wave64, BVH, cache, configuration, game asset, or binary changes are included. ## Validation - `cargo test --locked -p victory-gpu host::menu::tests` — **10 passed, 0 failed**, including explicit language selection and English fallback for `帧生成`. - `cargo test --locked -p victory-gpu` — **591 passed, 0 failed, 44 ignored**. - `cargo build --release -p victory --locked` — passed. - `cargo xtask policy --staged` — passed. - `git diff --check` ## Compatibility Chinese rendering is selected only when the user allows it and Windows can provide a Chinese glyph; otherwise the existing ASCII English menu remains available. Keyboard layout activation is independent from the menu language and remains opt-in through `VICTORY_IME_ENGLISH`.
Add GDI Chinese glyph rendering, translate the settings and key-binding UI, fix text-box sizing, and force the English keyboard layout while the game is focused.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 05:30:04 +00:00
Author
Owner

@⁠ANDREANIADS on GitHub · 2026-11-29 05:53 UTC · original

At 1def5f3, the F1 menu checks whether the font can render 简. In a synthetic test of the selector and paint logic, the label 帧生成 stayed Chinese with the probe enabled and became ??? with it disabled. The pt-BR and zh-CN scenarios gave identical results. This exercised character selection only, without GDI.

Could the menu offer an explicit language choice and select English strings when Chinese rendering is unavailable? Keeping VICTORY_IME_ENGLISH opt-in would also let users choose a menu language independently of whether the window requests a US keyboard layout on focus.

**@⁠ANDREANIADS** on GitHub · 2026-11-29 05:53 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1977#issuecomment-7251521769) At `1def5f3`, the F1 menu checks whether the font can render `简`. In a synthetic test of the selector and paint logic, the label `帧生成` stayed Chinese with the probe enabled and became `???` with it disabled. The pt-BR and zh-CN scenarios gave identical results. This exercised character selection only, without GDI. Could the menu offer an explicit language choice and select English strings when Chinese rendering is unavailable? Keeping `VICTORY_IME_ENGLISH` opt-in would also let users choose a menu language independently of whether the window requests a US keyboard layout on focus.
Keep English as the canonical menu text, add Auto/English/Chinese selection, fall back when GDI cannot render Chinese, and restore VICTORY_IME_ENGLISH as an independent opt-in switch.
Author
Owner

@⁠wrq2007 on GitHub · 2026-11-29 06:22 UTC · original

Addressed the review comments in 0fcd873:

  • Added VICTORY_MENU_LANGUAGE=auto|en|zh.
  • English is now the canonical fallback whenever Chinese glyph rendering is unavailable.
  • Added a regression test proving 帧生成 switches to FRAME GENERATION when Chinese rendering is disabled.
  • Restored VICTORY_IME_ENGLISH as an independent opt-in switch.

Validation: 10 menu tests passed; full victory-gpu suite passed with 591 passed, 0 failed, 44 ignored; release build and asset policy passed.

**@⁠wrq2007** on GitHub · 2026-11-29 06:22 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1977#issuecomment-7251816479) Addressed the review comments in 0fcd873: - Added `VICTORY_MENU_LANGUAGE=auto|en|zh`. - English is now the canonical fallback whenever Chinese glyph rendering is unavailable. - Added a regression test proving `帧生成` switches to `FRAME GENERATION` when Chinese rendering is disabled. - Restored `VICTORY_IME_ENGLISH` as an independent opt-in switch. Validation: 10 menu tests passed; full `victory-gpu` suite passed with 591 passed, 0 failed, 44 ignored; release build and asset policy passed.
Author
Owner

@⁠SkivHisink on GitHub · 2026-11-29 06:28 UTC · original

The updated auto|en|zh picker covers English and Simplified Chinese. Could we also support Spanish, German, Russian, Hindi, and French?

It would help if auto followed the user's Windows UI language preferences. The current font probe can select Chinese on a system whose UI is set to another language.

I opened #1997 with all seven languages, Windows UI language detection, and a manual choice that applies immediately and is saved.

**@⁠SkivHisink** on GitHub · 2026-11-29 06:28 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1977#issuecomment-7251879790) The updated `auto|en|zh` picker covers English and Simplified Chinese. Could we also support Spanish, German, Russian, Hindi, and French? It would help if `auto` followed the user's Windows UI language preferences. The current font probe can select Chinese on a system whose UI is set to another language. I opened #1997 with all seven languages, Windows UI language detection, and a manual choice that applies immediately and is saved.
Author
Owner

@⁠wrq2007 on GitHub · 2026-11-29 06:34 UTC · original

Thanks for opening #1997 and adding the broader language support. My concern is maintenance and verification: I can review English and Chinese, but I can’t reliably validate Spanish, German, Russian, Hindi, or French. I’d prefer to keep this PR focused on English and Chinese unless there are contributors willing to help maintain and review those translations.

**@⁠wrq2007** on GitHub · 2026-11-29 06:34 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1977#issuecomment-7251940464) Thanks for opening #1997 and adding the broader language support. My concern is maintenance and verification: I can review English and Chinese, but I can’t reliably validate Spanish, German, Russian, Hindi, or French. I’d prefer to keep this PR focused on English and Chinese unless there are contributors willing to help maintain and review those translations.
Author
Owner

@⁠ANDREANIADS on GitHub · 2026-11-29 07:29 UTC · original

At 0fcd873, I isolated the F1 save loop with auto → en and an FPS control 1000 → 60. The temporary victory-settings.txt contained both VICTORY_MENU_LANGUAGE=en and VICTORY_MENU_FPS=60. Reading that same file with play.rs’s parse_menu and settings produced FPS 60 and no language key. The settings blocks from scripts/play-foxhound.ps1 gave the same result. Both skip generic VICTORY_MENU_* entries and restore FPS explicitly. With Chinese glyphs available, the missing en lets the next menu select Chinese again.

Could both launch paths explicitly forward a saved auto|en|zh, keeping the reserved-key filter? A round-trip test asserting both values in the launch environment would cover this. Only isolated configuration code ran.

**@⁠ANDREANIADS** on GitHub · 2026-11-29 07:29 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1977#issuecomment-7252503044) At `0fcd873`, I isolated the F1 save loop with `auto → en` and an FPS control `1000 → 60`. The temporary `victory-settings.txt` contained both `VICTORY_MENU_LANGUAGE=en` and `VICTORY_MENU_FPS=60`. Reading that same file with `play.rs`’s `parse_menu` and `settings` produced FPS `60` and no language key. The settings blocks from `scripts/play-foxhound.ps1` gave the same result. Both skip generic `VICTORY_MENU_*` entries and restore FPS explicitly. With Chinese glyphs available, the missing `en` lets the next menu select Chinese again. Could both launch paths explicitly forward a saved `auto|en|zh`, keeping the reserved-key filter? A round-trip test asserting both values in the launch environment would cover this. Only isolated configuration code ran.
Author
Owner

@⁠wrq2007 on GitHub · 2026-11-29 07:38 UTC · original

Thanks for isolating this. Agreed: the saved value is persisted correctly, but both launch paths drop VICTORY_MENU_LANGUAGE when building the child environment. I’ll explicitly forward the validated auto|en|zh value in play.rs and play-foxhound.ps1, while keeping the reserved-key filter. I’ll also add a round-trip test with VICTORY_MENU_LANGUAGE=en and VICTORY_MENU_FPS=60 asserting both values reach the launch environment. No new config file is needed.

**@⁠wrq2007** on GitHub · 2026-11-29 07:38 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1977#issuecomment-7252597052) Thanks for isolating this. Agreed: the saved value is persisted correctly, but both launch paths drop `VICTORY_MENU_LANGUAGE` when building the child environment. I’ll explicitly forward the validated `auto|en|zh` value in `play.rs` and `play-foxhound.ps1`, while keeping the reserved-key filter. I’ll also add a round-trip test with `VICTORY_MENU_LANGUAGE=en` and `VICTORY_MENU_FPS=60` asserting both values reach the launch environment. No new config file is needed.
Keep auto|en|zh in the child launch environment without weakening the reserved VICTORY_MENU_* filter, and cover the language/FPS round trip in Rust and PowerShell tests.
This pull request has changes conflicting with the target branch.
  • apps/victory/src/play.rs
  • crates/victory-gpu/src/host/font.rs
  • crates/victory-gpu/src/host/menu.rs
  • crates/victory-hle/src/modules/lifecycle.rs
  • scripts/play-foxhound.ps1
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1977/head:github-bot/gh-1977'
git switch 'github-bot/gh-1977'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1977'
git switch 'github-bot/gh-1977'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1977'
git switch 'github-bot/gh-1977'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1977'
git switch 'main'
git merge --squash 'github-bot/gh-1977'
git switch 'main'
git merge --ff-only 'github-bot/gh-1977'
git switch 'main'
git merge 'github-bot/gh-1977'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA!1977
No description provided.