i18n: add language packs to the launcher and in-game menus #40

Open
HuemengHm wants to merge 1 commit from upstream-pr/40 into main
HuemengHm commented 2026-12-04 08:35:29 +00:00 (Migrated from github.com)

Imported from ReTerryDavis/ReVIctory. Originally posted by HuemengHm on 2026-12-04T08:35:29Z.


Summary

Players can choose English or Simplified Chinese in the launcher's top bar or under F1 → Overlay → Interface language. The game menu and F3 HUD update immediately. Both use the same saved preference, and the launcher picks up a change made in game when the game closes.

What changed

  • Move interface text into TOML catalogs keyed by stable message IDs. Adding another language requires a catalog and a rebuild. Both selectors discover it automatically. Regional packs can inherit translations, and missing messages fall back to English.
  • Apply the selected language to progress, graphics settings and their feedback, the account picker, and the HUD. Stored notices follow language changes. Vehicle and clothing searches accept names in either bundled language, and custom profile names and paths keep their original spelling.
  • Use the language's plural rules for file and profile counts. On narrow screens, account-picker shortcuts wrap before the Cancel button. The launcher also gives longer cache notices room to wrap.

Testing

  • Ran cargo test --locked -p victory-core -p xtask, including a fixture that adds Polish and a regional pack using only TOML and checks plural forms and fallback.
  • Checked the workspace with Clippy for x86_64-pc-windows-msvc using -D warnings, for both the default and diagnostics configurations.
  • Exercised language switching in egui, including a stored weather notice, bilingual search, and a custom profile named Clear. Checked the account picker at 360 and 800 points.

Native Win32 launcher interaction and a live D3D12 game session still need testing on Windows.

<!-- greyfinch-sync:ReTerryDavis/ReVIctory:issue:5643157775 --> Imported from [ReTerryDavis/ReVIctory](https://github.com/ReTerryDavis/ReVIctory/pull/40). Originally posted by [HuemengHm](https://github.com/HuemengHm) on 2026-12-04T08:35:29Z. --- ## Summary Players can choose English or Simplified Chinese in the launcher's top bar or under **F1 → Overlay → Interface language**. The game menu and F3 HUD update immediately. Both use the same saved preference, and the launcher picks up a change made in game when the game closes. ## What changed - Move interface text into TOML catalogs keyed by stable message IDs. Adding another language requires a catalog and a rebuild. Both selectors discover it automatically. Regional packs can inherit translations, and missing messages fall back to English. - Apply the selected language to progress, graphics settings and their feedback, the account picker, and the HUD. Stored notices follow language changes. Vehicle and clothing searches accept names in either bundled language, and custom profile names and paths keep their original spelling. - Use the language's plural rules for file and profile counts. On narrow screens, account-picker shortcuts wrap before the Cancel button. The launcher also gives longer cache notices room to wrap. ## Testing - Ran `cargo test --locked -p victory-core -p xtask`, including a fixture that adds Polish and a regional pack using only TOML and checks plural forms and fallback. - Checked the workspace with Clippy for `x86_64-pc-windows-msvc` using `-D warnings`, for both the default and diagnostics configurations. - Exercised language switching in egui, including a stored weather notice, bilingual search, and a custom profile named `Clear`. Checked the account picker at 360 and 800 points. Native Win32 launcher interaction and a live D3D12 game session still need testing on Windows.
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/40:upstream-pr/40'
git switch 'upstream-pr/40'

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/40'
git switch 'upstream-pr/40'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/40'
git switch 'upstream-pr/40'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/40'
git switch 'main'
git merge --squash 'upstream-pr/40'
git switch 'main'
git merge --ff-only 'upstream-pr/40'
git switch 'main'
git merge 'upstream-pr/40'
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
ReTerryDavis/ReVIctory!40
No description provided.