[i18n] Native localisation interface + external locales (en, zh-CN, zh-TW, ja, ko, fr-FR, ru-RU) #4913
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!4913
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-4912"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@WanderLinks on GitHub · 2026-12-01 13:35 UTC · original
WanderLinks:i18n→main· +7416 −903 · 50 files · 24 commits · closed without mergingMotivation
The F1 menu is hardcoded uppercase English (menu.rs, ITEMS,
46 entries) drawn with a 5x7 Latin-only glyph table
(font.rs). Non-English users cannot read the settings.
Third-party launchers already ship their own Chinese
translations, so the demand is real. This PR turns
language into an interface plus external files.
What this PR does
victory-i18n:Localizertrait,
PassthroughLocalizer(default, English unchanged),FileLocalizer(external TOML subset), offlineDictionary(glossary.toml) in place of onlineauto-translation (deliberately cut: no network, no keys).
(47 labels incl. the language row, 9 actions, 37 values,
title, help, marks, notes, 174 explanation lines:
288 keys per language). Explanations are fully
translated in all 7 languages (drafts, not reviewed
by native speakers; the file headers say so).
live, saved at once): Auto follows the Windows display
language (zh-Hant -> zh-TW, zh-Hans -> zh-CN), or pick
one of the 7 languages; switching reloads the menu.
as 2 cells), so the
< value >column lines up.(font fallback chain, dot-glyph fallback on failure);
DirectWrite is a follow-up, the interface is ready.
scale()helper, one stepper 360 lines of back-buffer height: scale 3 at 1080p,
the box covers 57% x 83% of the frame instead of
38% x 50%); the panel scales with it. GDI text is now
antialiased (
ANTIALIASED_QUALITY, not ClearType).CELL.1is 10 (was 9),so a row is 30px at scale 3 against a 24px GDI character
(
FONT_EM * scale, decoupled from the cell — a glyph as tallas its cell would leave only ~6px of leading), ~9px leading,
the original launcher's 1.41 pitch-to-glyph ratio; glyphs
are drawn with
TextOutW, one grid cell per character (therendering the user approved in the 16:44 screenshot; a
GetGlyphOutlineWrasteriser with natural advances wastried and reverted at the user's decision — see DESIGN.md
§9); the
< value >column is still fixed (the value, thetitle's close text and a bindings row's value all start at
their grid column); labels are cut to a 27-cell field before
padding; the key-bindings screen uses the same width rule. The
27-cell cap applies only to localised menus — the
upstream English ASYNC SUBMIT (37 cells) is shown whole,
as before. 8 over-long labels were shortened in the
language files (zh-CN 2, ja 4, ru 2).
VICTORY_LOCALE_DIR, VICTORY_TEXT_BACKEND,
VICTORY_DICTIONARY.
Tests
cargo test -p victory-i18n: 15 unit tests + 1integration test pass (7 languages x 288 keys), on
Linux (Rust 1.98.1) and Windows 11 (Rust 1.98.1,
VS 2022 BuildTools MSVC 14.44).
cargo clippy -p victory-i18n --all-targets -- -D warnings: clean on both.cargo check -p victory-gpu: pass.cargo test -p victory-gpu menu: 39 tests pass,incl. language-row switching, value translation,
CJK width, upstream-insert/rename fallback, the
dictionary fallback for a deleted translation, and
the 27-cell label cap for localised menus.
cargo test -p victory-gpu gdi_draws: 2 pixel testspass — the value bracket
<lands in the same columnon a Latin-label row and a Chinese-label row; a bindings
row's value lands in the same column although it has no
<(checked by its ink's midpoint —Wis wider thanits 18px cell, so its ink overhangs the cell on both
sides). A third pixel test (natural advances) was removed
with the reverted rasteriser.
cargo clippy --workspace,cargo test --workspace): run 2026-12-01. Clippyfails on 3 pre-existing upstream issues and 3 tests
fail, all verified identical on a clean v2026.11.30.03
checkout (see DESIGN.md §9); none is caused by this PR.
Latest full
cargo test -p victory-gpure-run after therasteriser was reverted: 1143 pass / 3 fail (2
deterministic upstream bugs + 1 timing-sensitive test
that passes standalone).
vs =0): the menu is verified on real hardware through
several rounds (row pitch, value-column alignment,
brackets, TOML switch all confirmed by user screenshots);
after the rasteriser was reverted, the 2026-12-01 18:48
user screenshot confirmed it again: no crash, menu as in
the 16:44 image, 30 fps at the cap.
17:52, with the rasteriser build) was investigated and is
NOT caused by this PR: the fault is a stack buffer overrun
inside the NVIDIA driver (nvwgf2umx.dll 32.0.16.1074)
during D3D12 shader compilation at startup, with zero
victory.exe frames on the faulting thread's stack; the game
had crashed the same way before. Reverting the rasteriser
does not fix it — it is a driver-side issue (see
DESIGN.md §9).
Risks and rollback
-> dictionary -> English -> original text, never empty,
never a panic. A new upstream menu item with no
translation shows English until translated.
speakers welcome to correct them.
Prior art (checked 2026-12-01, see REFERENCES.md)
key-bindings screen in Chinese, hardcoded tr("EN", "ZH")
pairs, no external files, VICTORY_MENU_LANGUAGE. Its saved
language choice was lost at launch (the child-process env
skipped VICTORY_MENU_* items); this PR keeps the choice in
the settings file and the game process env, verified by a
restart round-trip (see REFERENCES.md §10). #1997 grew out
of #1977's comment thread (different author).
hardcoded in Rust, language row first, VICTORY_UI_LANGUAGE.
This PR keeps the same row position and Auto behaviour,
but the translations live in external files, so adding a
language needs no code change and no rebuild.
GDI drawing. This PR reuses the GDI approach with a
longer font fallback chain and covers 7 languages.
VICTORY_UI_LANGUAGE (#1997) / VICTORY_MENU_LANG (#2445).
VICTORY_LOCALE is the general switch; the row writes
VICTORY_MENU_LANGUAGE into the settings file (the same
variable name #1977 used).
Maintenance
recommended way to follow upstream is a branch on top
of upstream main, rebased as main moves; see DESIGN.md
§12 for what merges cleanly and what needs a human.
check-upstream.ps1(in this folder) checks whetherthe patches still apply to a clean checkout, no git
needed:
check-upstream.ps1 -Patch integration.patch -Checkout <clean v2026.11.30.03 tree>.@trustno1-coder on GitHub · 2026-12-01 18:28 UTC · original
Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.
Pull request closed