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

Open
EduBertozzi wants to merge 9 commits from upstream-pr/1618 into main
EduBertozzi commented 2026-11-24 19:51:58 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by EduBertozzi on 2026-11-24T19:51:58Z.


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

<!-- greyfinch-sync:Marvisak/VIctory:issue:6590130429 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1618). Originally posted by [EduBertozzi](https://github.com/EduBertozzi) on 2026-11-24T19:51:58Z. --- **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)
Marvisak commented 2026-11-25 02:06:10 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 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

<!-- greyfinch-sync:Marvisak/VIctory:comment:7149662529 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1618#issuecomment-7149662529). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T01:32:23Z. --- <!-- 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 cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/1618:upstream-pr/1618'
git switch 'upstream-pr/1618'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/1618'
git switch 'upstream-pr/1618'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1618'
git switch 'upstream-pr/1618'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1618'
git switch 'main'
git merge --squash 'upstream-pr/1618'
git switch 'main'
git merge --ff-only 'upstream-pr/1618'
git switch 'main'
git merge 'upstream-pr/1618'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
Marvisak/VIctory!1617
No description provided.