victory menu: speak Portuguese where Windows does (stacked on #1609) #1618

Open
github-bot wants to merge 9 commits from github-bot/gh-1618 into main AGit
Owner

@⁠EduBertozzi on GitHub · 2026-11-24 19:51 UTC · original
EduBertozzi:ux/menu-pt → main · +2125 −0 · 6 files · 9 commits · open

Stacked on #1609 (which is stacked on #959): this branch adds one commit, e62dd00, on top of them. Optional: if the project would rather keep the tools in English, this is easy to leave out.

What

The double-click menu, its PC check, the keyboard guide and the doctor's findings now follow Windows' display language. They come out in Portuguese where Windows is in Portuguese (GetUserDefaultUILanguage, primary language 0x16) and in English otherwise. VICTORY_LANG=en|pt overrides the choice.

How it works:

  • Each screen is still built in English. lang::localize translates the finished text by whole phrases (longest first) as the menu prints it, so the menu's logic and tests stay in one language.
  • Long hints are translated before they're wrapped.
  • Not translated: a run's log (VIctory's and the title's output), and the report copied for GitHub (3, then C), which stays English for the tracker.

Adding a language is a phrase table, the same as lang::PT. A test keeps the table honest: every English phrase in it must be one the menu or the doctor actually writes, so a reworded string can't leave a stale translation behind unnoticed.

Tested

Native Windows 10 22H2 (19045) with a Portuguese display language, GTX 1060:

  • cargo test -p victory: 22 tests. The new ones cover:
    • the table against the sources;
    • the Portuguese menu read whole;
    • longest-phrase-first;
    • tests running in English.
  • cargo clippy --workspace --all-targets --locked -- -D warnings, with and without --all-features: clean.
  • In the built victory.exe with no VICTORY_LANG set, it picked Portuguese by itself for the menu, the check (including the wrapped Windows 10 hint), a failed run and its What happened findings.

Not exercised in the exe: that the copied report stays English while the menu speaks Portuguese. That's lang::in_english around the report's text, but I skipped the clipboard round-trip, so as not to overwrite what the machine's clipboard held.

🤖 Generated with Claude Code

**@⁠EduBertozzi** on GitHub · 2026-11-24 19:51 UTC · [original](https://github.com/Marvisak/VIctory/pull/1618) `EduBertozzi:ux/menu-pt` → `main` · +2125 −0 · 6 files · 9 commits · open **Stacked on #1609** (which is stacked on #959): this branch adds one commit, [`e62dd00`](https://github.com/EduBertozzi/VIctory/commit/e62dd00), on top of them. Optional: if the project would rather keep the tools in English, this is easy to leave out. ## What The double-click menu, its PC check, the keyboard guide and the doctor's findings now follow Windows' display language. They come out in Portuguese where Windows is in Portuguese (`GetUserDefaultUILanguage`, primary language `0x16`) and in English otherwise. `VICTORY_LANG=en|pt` overrides the choice. How it works: - Each screen is still built in English. `lang::localize` translates the finished text by whole phrases (longest first) as the menu prints it, so the menu's logic and tests stay in one language. - Long hints are translated before they're wrapped. - **Not translated:** a run's log (VIctory's and the title's output), and the report copied for GitHub (*3*, then *C*), which stays English for the tracker. Adding a language is a phrase table, the same as `lang::PT`. A test keeps the table honest: every English phrase in it must be one the menu or the doctor actually writes, so a reworded string can't leave a stale translation behind unnoticed. ## Tested Native Windows 10 22H2 (19045) with a Portuguese display language, GTX 1060: - `cargo test -p victory`: 22 tests. The new ones cover: - the table against the sources; - the Portuguese menu read whole; - longest-phrase-first; - tests running in English. - `cargo clippy --workspace --all-targets --locked -- -D warnings`, with and without `--all-features`: clean. - In the built `victory.exe` with no `VICTORY_LANG` set, it picked Portuguese by itself for the menu, the check (including the wrapped Windows 10 hint), a failed run and its *What happened* findings. Not exercised in the exe: that the copied report stays English while the menu speaks Portuguese. That's `lang::in_english` around the report's text, but I skipped the clipboard round-trip, so as not to overwrite what the machine's clipboard held. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Double-clicking victory.exe printed clap's help in a console window that
closed before it could be read (#527). Started with no arguments in a
console of its own (`GetConsoleProcessList` gives one process), or with
VICTORY_MENU=1, it now shows a menu:

1. Run a game: drag the title's .exe onto the window, or type or paste
   its path. Quotes and PowerShell's `& '...'` are taken off. It runs as
   `victory run <exe> --execute` would.
2. Run again: the last game run from the menu, remembered in the data
   folder while the file is still there.
3. Check this PC, in two sections with a mark and a hint per line:
   * This PC: the Windows build (Windows 10's built-in D3D12 stops at
     SM 6.5, and the hint says whether a D3D12\ folder sits beside the
     exe), AVX2, and what a run of this executable gets from the GPU:
     SM 6.6, mesh shaders, the widest wave.
   * Paths: the game, data and cache folders.
4. Open the data folder (saves, crashes.log) in Explorer.

After a run, or a run that stops with an error, the window waits for
Enter so the last lines can be read. A wrong key shows what to type.

Colours: a sunset gradient of VIctory's own (dusk blue, violet, orchid,
pink, peach, amber) for the name and its horizon line, and marks in the
same palette. Nothing of the title's. Virtual-terminal sequences are
turned on in the console; NO_COLOR turns colour off, CLICOLOR_FORCE=1 on.
With arguments, or in a console another program already uses (cmd,
PowerShell, a terminal), nothing changes.

Tests: dragged and pasted paths, answers (and a byte-order mark before
piped input), the remembered game, the check's lines on Windows 10 with a
32-lane GPU without mesh shaders and on Windows 11 without SM 6.6, the
gradient, plain output without colour, and the "run again" line. A piped
run of check / wrong key / bad path / quit printed what's expected.
Dependencies: windows-sys (console, registry) and windows (D3D12 feature
queries) for the app, both already in the workspace; tempfile for tests.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Show the Windows 10 Agility hint only when the SM 6.6 check needs it
A run from the menu was `run::run` in the menu's own process, so a title
that crashed or exited took the window with it, and its last lines with
it. It is now a child `victory run <game> --execute` in the same console:
the menu says how it ended (the exit code, in hex for an NTSTATUS such as
0xC0000005) and waits for Enter. Ctrl+C and Ctrl+Break stop the run, not
the menu.

Also: hints wrap to the console's width, under the line they explain
(they ran back to the left edge); "Checking this PC..." shows while the
GPU device is made; the window is titled VIctory; opening the data folder
says which folder it opened.

Tried on Windows 10 19045 with a file that isn't a game: the child stops
with "malformed image", the menu shows exit code 1 and carries on.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
"Check this PC" now starts its GPU lines with the default adapter's name
and user-mode driver version from DXGI, which it reads also where no
shader model 6.6 device can be made (the case "can't run" reports are
about). After the check, C then Enter puts it on the clipboard as plain
text for a GitHub report: no colour, no wrapping, the user's profile
folder written as %USERPROFILE%, through the Win32 clipboard as Unicode
text with CRLF line ends.

Tried on Windows 10 19045 with a GTX 1060: the line reads "GPU: NVIDIA
GeForce GTX 1060 6GB (driver 32.0.15.8266)", and the copied text starts
with "VIctory 0.1.0", keeps the check marks and holds no profile path.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
PowerShell (Windows Terminal's default) pastes a dragged path as
`& 'D:\Games\Tom''s Game\title.exe'`, an apostrophe doubled inside single
quotes. The menu took the quotes off and kept `''`, so such a game was "No
file there". A double-quoted path (cmd) keeps its apostrophe as it is.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Three entries after the launcher in #1330 (sahajiscoding), written for
this menu:

- S sets [paths].game_dir in the config file the tools read
  (VICTORY_CONFIG, else victory.toml beside a double-clicked victory.exe).
  A dropped .exe stands for its folder. The active game_dir line is
  replaced, or one is added under [paths], or [paths] is appended. Every
  other line and comment stays. A folder inside the repository is
  refused with the asset-policy message, and the menu says when
  VICTORY_GAME_DIR overrides the file.
- K shows the keyboard's stand-in pad as gameinput.rs maps it and the
  README lists it.
- M switches the console model a run uses (victory run --console),
  remembered in the data folder.

Tests: the config edit on an empty file, on the example file (comments
kept, one game_dir), with and without [paths], with an apostrophe (a
basic string) and with CRLF, each read back with toml; the model
switch and its memory; the keys table; the run command's --console.
Tried in the built victory.exe with a scratch VICTORY_CONFIG: S from a
dragged .exe, M, K, and a repository folder refused.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Most "can't run" reports in the tracker are a problem already traced in
another issue: #998 was #741, and so on. A table of those problems
(apps/victory/src/doctor.rs) maps each to the text that shows it in a
run's output or crash log, with what it means and where it is tracked:

- Windows 10's built-in D3D12 too old (root signature flags c01)
- the title's instance pool full (+0x5149aec, INSTANCE_LIST)
- the Game Init crash at +0xb5a5f8
- no mesh shaders
- GPU hang (DXGI_ERROR_DEVICE_HUNG)
- 64-lane wave programs on a 32-lane GPU
- out of GPU memory
- out of commit (os error 1455)
- a file that isn't a title's executable

Only text that VIctory, D3D12 or the title print verbatim, and that an
issue has traced to a cause, is in it; anything else gets no guess.

After a run the menu now shows the run's log as it comes and keeps its
end. If the log or what the crash logs gained during the run match, it
lists the problems under "What happened". `victory doctor [FILES]` does
the same for a saved log, or for the data folder's crash logs.

Tests: each signature against a line as the issues quote it, colour
codes and case, order and repeats, a clean run getting nothing, only the
crash log's new part being read, the findings' layout, and a child's
error output shown and kept. Tried in the built victory.exe: a file that
isn't a title (the menu names it) and a log shaped like #998's
(`victory doctor` names both problems with their links).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The menu, the check, the keys and the doctor's findings now follow
Windows' display language: Portuguese where it is Portuguese
(GetUserDefaultUILanguage), English otherwise, and VICTORY_LANG=en|pt
chooses. Each screen is still built in English; lang::localize
translates the finished text by whole phrases (longest first) as it is
printed, so the menu's logic and tests stay in one language. Long
hints are translated before they are wrapped. A run's log is never
translated, and the report copied for GitHub stays English.

Tests: every phrase in the table is one the menu or the doctor writes
(so the table can't go stale silently), the Portuguese menu reads whole,
longer phrases win over shorter ones inside them, and tests run in
English. Tried in the built victory.exe on a Portuguese Windows 10: it
picked Portuguese by itself for the menu, the check, a failed run and
its findings.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:38:36 +00:00
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 01:32 UTC · original

Automated triage for the maintainers.

Needs rebase. This pull request conflicts with main (conflicting: Cargo.lock, apps/victory/src/main.rs). It will be reviewed once it is rebased onto the current main.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 01:32 UTC · [original](https://github.com/Marvisak/VIctory/pull/1618#issuecomment-7149662529) <!-- victory-triage v1 head=e62dd007815a5a52d19ed6157bcda534decface9 verdict=needs-rebase at=2026-11-25T01:32:23Z --> Automated triage for the maintainers. **Needs rebase.** This pull request conflicts with `main` (conflicting: `Cargo.lock`, `apps/victory/src/main.rs`). It will be reviewed once it is rebased onto the current `main`. --- _Generated by [Claude Code](https://claude.ai/code)_
This pull request has changes conflicting with the target branch.
  • Cargo.lock
  • apps/victory/src/main.rs
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/1618/head:github-bot/gh-1618'
git switch 'github-bot/gh-1618'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1618'
git switch 'github-bot/gh-1618'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1618'
git switch 'github-bot/gh-1618'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1618'
git switch 'main'
git merge --squash 'github-bot/gh-1618'
git switch 'main'
git merge --ff-only 'github-bot/gh-1618'
git switch 'main'
git merge 'github-bot/gh-1618'
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/Marvisak--VIctory!1618
No description provided.