fix(menu): the game's language is kept with the player's settings, so an update keeps it #2794

Merged
HumanBean merged 16 commits from llun/Longshot:fix/game-language-in-options into main 2026-11-29 19:25:27 +00:00
Member

Summary

A player reported that their game, set to Chinese in the game's menu, went back to English after every launcher update. The game's language lived in language.txt in the game folder, which every build writes again with the language it was asked for. So any update or rebuild that named another language (the launcher's update wizard always names one) undid the player's choice.

The language now lives only in the player's settings: game_language=<code> in the profile's settings.ini, which no build writes over a choice. language.txt is gone: no build writes it and the game writes none. That was the maintainer's call: the new launcher plays only builds of a builder that has game_language=, so this migration happens now rather than after the next stable release. HOS_LANGUAGE still wins for one run.

On main: set Gameplay → Game language to 简体中文, restart, then update or rebuild the version from the launcher with English as its language. The game starts in English. Here: it starts in Chinese, and the log says oe: language zh-Hans (game_language in the settings).

What changed, in reading order:

  • host/options_path.c hos_language_move (called in host/hos_main.c right after the settings carry, before the game or the menu reads the language): a language.txt a build from before left in the game folder is moved into the settings once. Its language is added as game_language= when the settings hold none (a file is made with that line when there is none), then the file is removed; a leftover under a choice is removed too. The settings are written first, whole, so a kill before the removal leaves the line, and the next start removes the leftover. With no settings file this run, or one that can't be written, the leftover stays and is read.
  • host/nn_applet.c desired_language: HOS_LANGUAGE, else the settings' game_language, else such a leftover, else English (US). No first-start language.txt template any more.
  • gpu/vk/vk_menu_i18n.cpp, gpu/vk/vk_menu.cpp: the same rule for the Insert menu. The Game language row's choice is saved with the settings when the row is left, then read back from the file; a save that could not write it puts the choice and the row back. With no choice, the row's fallback is read once, not at each frame.
  • host/options_path.c: a profile settings.ini holding only game_language= still gets the game folder's old settings copied in once, with the line kept; a read that fails part way writes nothing; a profile file that can't be read is left alone.
  • Builder (build.rs, folder.rs put_language, settings_path, remove_language_txt, menu_language): a build writes no language.txt. It puts a language in the settings only when they hold no game_language=: the profile's settings.ini, or without --profile the settings the game then reads (config/settings.ini, a flat folder's longshot_options.ini). The language is the one an older game's menu chose (a language.txt newer than the folder's build record, in a folder whose record lacks the game_language feature), else the build's (--language, the profile's profile.json language, else the system's). A leftover language.txt is removed. A choice in the settings, the Insert menu's or the launcher's, is never written over.
  • play.rs: the language is out of the profile's build key, so a change needs no rebuild. verify.rs: language.txt is no longer the player's data (a leftover is reported as an extra and left alone).
  • The Menu language row's Auto hint no longer names language.txt (its 13 translations shortened the same way). Player and developer docs say where the language is kept; CONTRIBUTING and assets/saves/README.md keep language.txt banned as an old file.

The launcher side (a Game language row on each profile that writes the same line, and the update wizard starting on it) is MagicBeanDev/LongshotLauncher#364.

Testing

Tested: Windows 11, NVIDIA GeForce RTX 5080, driver 621.40, the branch as a pack over the shared base (dev.py pack, dev.py rt), runs through the job queue, headless, no sound device, HOS_FS_TRACE=1. A throwaway profile whose settings.ini held only game_language=zh-Hans, over a build whose language.txt says en-US:

  • main @ 3ab4db6e9: oe: language en-US (language.txt); the game opened Mals/USen.
  • this PR @ b3cbc4d59 (after the review's fixes), on main 01d6878b3: oe: language zh-Hans (game_language in the settings); the game opened Mals/CNzh; the game folder's config/settings.ini was copied into the profile once (options: the settings in ... were copied to ...) with the one game_language=zh-Hans line kept; the run stopped with stop: close work done.
  • this PR @ 9d7ffe68a (before review), on main 01d6878b3: oe: language zh-Hans (game_language in the settings); the game opened Mals/CNzh, the run stopped with stop: close work done, and the game's own settings save kept game_language=zh-Hans in the profile.
  • The launcher PR's Game language row wrote the same game_language=zh-Hans into a profile's settings.ini (by hand, on this PC).

Checks: tests/test_game_language.py (new) fails on main for the bug's reasons and passes here. It covers desired_language cut from nn_applet.c and compiled, the menu's language functions cut from vk_menu_i18n.cpp and compiled, and options_path.c's one-time copy built whole. The whole suite, tests/run_all.py on Linux (WSL Ubuntu 24.04, gcc 13, clang++ standing in for g++): 694 passed, 30 failed, 172 skipped. 29 of the failures fail the same way on main @ 01d6878b3 on this PC: test_crt_options, test_check_third_party, test_thinlto_tls, test_switch_table, test_dev_update, test_program_cache_one_variant, test_program_cache_cleanup, test_guest_holes, test_log_levels, test_linux_pressure, test_loaded_modules_drop, test_control_picture, test_menu_keys, test_perf_send, test_upscaler_round_trip, test_pipeline_tour, test_crt_shaders, test_input_background, test_option_ids, test_vcore_video_acquire, test_video_catchup, test_crash_record, test_video_input_limit, test_video_hold_early, test_windows_on_linux, test_xinput_thread, test_screensaver, test_bug_report and byte_compile_tracked (it needs git, which can't read this worktree from WSL; it passes on Windows). The 30th, test_menu_env_overrides, cuts save() and lacked a stand-in for the new game_language_choice: it has one now and passes. Every check that reads a changed file (run_all.py --changed, 38) passes, plus test_game_language, test_options_path, test_settings_atomic, test_menu_i18n_count and test_menu_restart. The builder's new an_update_keeps_the_language_chosen_in_the_game passes, and cargo clippy -p build-driver is clean.

After review (b3cbc4d59): test_game_language gained the review's cases (the row's choice put back when the save cannot write the settings, a failed read in the one-time copy, the runner's {cc}/{cxx}); they fail on the pre-review head 339f528f6 for those reasons and pass here (gcc and clang). The builder's new end-to-end an_update_from_an_older_game_keeps_the_language_its_menu_chose (driver.rs: a flat older folder, a profile with no settings.ini, then a second update) fails on 339f528f6 (left: None) and passes here; cargo test -p build-driver (160 + 7 + 4 passed), cargo clippy -p build-driver --all-targets -D warnings and cargo fmt --check -p build-driver are clean. Every check run_all.py --changed picks (142 with --no-skip --strict), on WSL Ubuntu 24.04: 116 passed, 7 failed, 19 skipped (no cargo, cmake, spirv-val or Vulkan headers there); the 7 are in the main-failing list above (test_crt_options, test_upscaler_round_trip, test_pipeline_tour, test_menu_keys, test_input_background, test_bug_report, byte_compile_tracked). ruff passes on the changed Python. check_guide_screenshots.py --review-sources and test_guide_screenshots.py pass: settings-graphics.png is kept, its review recorded (Graphics, Audio and Controls rendered with the UI-only helper from main and from 4d6d3547 differ only in the version text's box). cargo fmt --check flags only build-compile/src/host_sources_tests.rs, which main flags too. The changed C and C++ files built whole in the pack (llvm-mingw, Windows).

After the second review (9f1b01617): an older folder's language.txt counts as the menu's only when it is newer than the folder's build record. an_update_keeps_the_language_chosen_in_the_game and an_update_from_an_older_game_keeps_the_language_its_menu_chose now cover a player who never chose: a language.txt the older build wrote, then an update with another language, writes no game_language=. They fail on b3cbc4d59 for that (the build's own language.txt, and a settings.ini written) and pass here. cargo test -p build-driver (160 + 7 + 4 passed), clippy (-D warnings) and cargo fmt --check are clean. Only the builder changed, so the game run above still holds.

After futondestroyer's review (c8b4ec305, rebased on main f14a5664d): three new cases fail on 9f1b01617 for the review's reasons and pass here. a_menu_choice_is_kept_when_the_first_update_asks_for_the_same_language (driver.rs: a menu choice of zh-Hans, a first update asking for zh-Hans, then a second asking for en-US; on 9f1b01617 the profile got nothing, left: None). test_game_language: a profile settings.ini that can't be read (a folder in its place) is left alone, with no copy tried (on 9f1b01617 the copy was tried over it). And with no choice, the row's language.txt fallback is read once (on 9f1b01617 a change to the file showed at the next frame). cargo test -p build-driver (160 + 8 + 4 passed), cargo clippy -p build-driver --all-targets --no-deps -D warnings (without --no-deps, clippy now stops on main's build-compile, from #2782) and cargo fmt --check are clean. Every check run_all.py --changed picks (144), on WSL: 117 passed, 8 failed, 19 skipped; the 8 fail the same way on main: the 7 above and test_keyboard_option (new on main with #152, failing there with "the host cannot see the Keyboard row"). The guide check passes again: rendered from main f14a5664 and from b7f2825c, the pages differ only in the version text's box, recorded in the manifest. In the game, @ c8b4ec305 over the shared base, through the queue: the throwaway profile with only game_language=zh-Hans gave oe: language zh-Hans (game_language in the settings), Mals/CNzh, the game folder's settings copied in once with the one line kept, and stop: close work done. A profile whose settings.ini was a folder gave options: ...settings.ini could not be read: left as it is, the game folder's settings not put over it, the game in language.txt's English, the folder untouched, and a clean stop.

Rebased on main b6d274d77 (9ef12bc71); this PR's commits are unchanged, and #2790 and #2803 touch only the Linux profiler and the Linux display, so the game run at c8b4ec305 still holds. mise run test on Windows (llvm-mingw, MSYS2's gcc, g++, glslang and spirv-val on PATH) @ 283a779de, on main 01539efd2: 807 passed, 48 failed, 47 skipped. 46 of the 48 fail the same way on main 01539efd2 on this PC. The other 2, test_dev_ab and test_present_semaphores, read none of this PR's files, pass on main and pass here when run alone: they failed under the full run's load. test_game_language, test_options_path, test_settings_atomic and test_menu_env_overrides pass on Windows at 9ef12bc71.

After removing language.txt (the maintainer's call; 6b5b4151b, on main b6d274d77): the new cases fail on 9ef12bc71 and pass here. In test_game_language: no template is written at the start, and a leftover is moved once, kept under a choice, removed, and makes a settings file when there is none. In driver.rs: a build writes no language.txt and seeds a profile with no choice, --language without a profile goes into config/settings.ini, and a choice is never written over. play.rs: the key no longer holds the language. verify.rs: a leftover is reported as an extra. cargo test -p build-driver (160 + 9 + 4), -p launcher-profile, clippy (--no-deps -D warnings) and cargo fmt --check pass. -p longshot-builder has 6 failures and -p build-compile 2 toolchain ones, the same that fail on main b6d274d77 on this PC. mise run test (Windows, MSYS2's tools on PATH): 811 passed, 45 failed, 47 skipped; all 45 are among the 48 of the run above, which fail on main but for its 2 load flakes. The guide check passes, the pages rendering as on main but for the version text. In the game (Windows 11, RTX 5080, NVIDIA 621.40, the branch as a pack over the shared base, through the queue, headless):

  • A profile with no settings over a game folder with a leftover zh-Hans language.txt: options: ...config/language.txt's language zh-Hans moved into ...settings.ini (game_language=), oe: language zh-Hans (game_language in the settings), Mals/CNzh. The leftover was gone afterwards, the profile kept game_language=zh-Hans, and the run stopped cleanly.
  • A profile with game_language=ja: oe: language ja (game_language in the settings), Mals/JPja, a clean stop.

Still to test:

  • Windows, by hand: a version built by a game from before this PR, its language changed to 简体中文 in the game's menu, then updated from the launcher to a build of this PR with English named. Expecting the profile's settings.ini to gain game_language=zh-Hans (the builder's log line the game's language chosen in its menu (zh-Hans) kept in .../settings.ini (game_language), naming the profile's settings.ini, and no language.txt left in the game folder). The same with the update asking for 简体中文, then a second one asking for English: the profile keeps game_language=zh-Hans and the game to start in Chinese.
  • Linux: the same profile run as above, expecting oe: language zh-Hans (game_language in the settings) (@Beanstalk run a build of this PR on Linux with a profile whose settings.ini holds only game_language=zh-Hans over a language.txt of en-US; expect the game in Chinese and that log line).

Measurements

Nothing to measure: the language is read once at the start, and the settings line is written only when the Game language row is left.

Risks

  • A player who never chose a language sees the same language: their next build puts the build's language in their settings as game_language=, and that is what the game reads.
  • A player who chose one in the game's menu before this keeps it: the first update to this copies it into the profile's settings, whatever language that update asks for.
  • That first update tells a menu choice from the build's own language by time: only a language.txt written after the folder's build record counts. One case it can still misread: an older builder rebuilt the folder for a new language and changed nothing else (so it left the record unwritten), and this update names yet another one. Then the folder's language is kept once. With the launcher PR, the launcher writes the update's language over it after the build when the player chose one in the wizard. Later updates aren't affected: the folder then has the game_language feature.
  • Once chosen, the language follows the profile. The launcher's update wizard no longer changes it on its own (the launcher PR keeps its field and the profile's choice the same). HOS_LANGUAGE still overrides it for one run.
  • An older game build would fall back to English: it reads only language.txt, which builds no longer write. The new launcher plays only builds of a builder that has game_language= (the maintainer's call).
  • A revert leaves the language in the settings, where the reverted game doesn't look; an older build would fall back to English until a build writes language.txt again.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit.
  • Tested on my own PC, in the game for a change the game runs, as Testing says.
  • mise run test passes (any failure that also fails on main is named).
  • Measured against main, or Measurements says why there is nothing to measure.
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.

When it applies

  • A fix: a game-free test that fails on main and passes here.
  • A check under tests/ that reads changed source is updated, not weakened.
  • Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths.
  • Docs updated.
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.

Ready to merge

  • Everything in Still to test has run, its results in Tested.
  • Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers").
  • Approved in review, every comment answered.
  • CI passes on the head; on current main, measured again or a comment says why the numbers still hold.

🤖 Generated with Claude Code

## Summary A player reported that their game, set to Chinese in the game's menu, went back to English after every launcher update. The game's language lived in `language.txt` in the game folder, which every build writes again with the language it was asked for. So any update or rebuild that named another language (the launcher's update wizard always names one) undid the player's choice. The language now lives only in the player's settings: `game_language=<code>` in the profile's `settings.ini`, which no build writes over a choice. `language.txt` is gone: no build writes it and the game writes none. That was the maintainer's call: the new launcher plays only builds of a builder that has `game_language=`, so this migration happens now rather than after the next stable release. `HOS_LANGUAGE` still wins for one run. **On main:** set Gameplay → Game language to 简体中文, restart, then update or rebuild the version from the launcher with English as its language. The game starts in English. **Here:** it starts in Chinese, and the log says `oe: language zh-Hans (game_language in the settings)`. What changed, in reading order: - `host/options_path.c` `hos_language_move` (called in `host/hos_main.c` right after the settings carry, before the game or the menu reads the language): a `language.txt` a build from before left in the game folder is moved into the settings once. Its language is added as `game_language=` when the settings hold none (a file is made with that line when there is none), then the file is removed; a leftover under a choice is removed too. The settings are written first, whole, so a kill before the removal leaves the line, and the next start removes the leftover. With no settings file this run, or one that can't be written, the leftover stays and is read. - `host/nn_applet.c` `desired_language`: `HOS_LANGUAGE`, else the settings' `game_language`, else such a leftover, else English (US). No first-start `language.txt` template any more. - `gpu/vk/vk_menu_i18n.cpp`, `gpu/vk/vk_menu.cpp`: the same rule for the Insert menu. The Game language row's choice is saved with the settings when the row is left, then read back from the file; a save that could not write it puts the choice and the row back. With no choice, the row's fallback is read once, not at each frame. - `host/options_path.c`: a profile `settings.ini` holding only `game_language=` still gets the game folder's old settings copied in once, with the line kept; a read that fails part way writes nothing; a profile file that can't be read is left alone. - Builder (`build.rs`, `folder.rs` `put_language`, `settings_path`, `remove_language_txt`, `menu_language`): a build writes no `language.txt`. It puts a language in the settings only when they hold no `game_language=`: the profile's `settings.ini`, or without `--profile` the settings the game then reads (`config/settings.ini`, a flat folder's `longshot_options.ini`). The language is the one an older game's menu chose (a `language.txt` newer than the folder's build record, in a folder whose record lacks the `game_language` feature), else the build's (`--language`, the profile's `profile.json` `language`, else the system's). A leftover `language.txt` is removed. A choice in the settings, the Insert menu's or the launcher's, is never written over. - `play.rs`: the language is out of the profile's build key, so a change needs no rebuild. `verify.rs`: `language.txt` is no longer the player's data (a leftover is reported as an extra and left alone). - The Menu language row's Auto hint no longer names `language.txt` (its 13 translations shortened the same way). Player and developer docs say where the language is kept; CONTRIBUTING and `assets/saves/README.md` keep `language.txt` banned as an old file. The launcher side (a Game language row on each profile that writes the same line, and the update wizard starting on it) is [MagicBeanDev/LongshotLauncher#364](https://git.magicbean.dev/MagicBeanDev/LongshotLauncher/pulls/364). ## Testing **Tested:** Windows 11, NVIDIA GeForce RTX 5080, driver 621.40, the branch as a pack over the shared base (`dev.py pack`, `dev.py rt`), runs through the job queue, headless, no sound device, `HOS_FS_TRACE=1`. A throwaway profile whose `settings.ini` held only `game_language=zh-Hans`, over a build whose `language.txt` says `en-US`: - main @ 3ab4db6e9: `oe: language en-US (language.txt)`; the game opened `Mals/USen`. - this PR @ b3cbc4d59 (after the review's fixes), on main 01d6878b3: `oe: language zh-Hans (game_language in the settings)`; the game opened `Mals/CNzh`; the game folder's `config/settings.ini` was copied into the profile once (`options: the settings in ... were copied to ...`) with the one `game_language=zh-Hans` line kept; the run stopped with `stop: close work done`. - this PR @ 9d7ffe68a (before review), on main 01d6878b3: `oe: language zh-Hans (game_language in the settings)`; the game opened `Mals/CNzh`, the run stopped with `stop: close work done`, and the game's own settings save kept `game_language=zh-Hans` in the profile. - The launcher PR's Game language row wrote the same `game_language=zh-Hans` into a profile's `settings.ini` (by hand, on this PC). Checks: `tests/test_game_language.py` (new) fails on main for the bug's reasons and passes here. It covers `desired_language` cut from `nn_applet.c` and compiled, the menu's language functions cut from `vk_menu_i18n.cpp` and compiled, and `options_path.c`'s one-time copy built whole. The whole suite, `tests/run_all.py` on Linux (WSL Ubuntu 24.04, gcc 13, clang++ standing in for g++): 694 passed, 30 failed, 172 skipped. 29 of the failures fail the same way on main @ 01d6878b3 on this PC: `test_crt_options`, `test_check_third_party`, `test_thinlto_tls`, `test_switch_table`, `test_dev_update`, `test_program_cache_one_variant`, `test_program_cache_cleanup`, `test_guest_holes`, `test_log_levels`, `test_linux_pressure`, `test_loaded_modules_drop`, `test_control_picture`, `test_menu_keys`, `test_perf_send`, `test_upscaler_round_trip`, `test_pipeline_tour`, `test_crt_shaders`, `test_input_background`, `test_option_ids`, `test_vcore_video_acquire`, `test_video_catchup`, `test_crash_record`, `test_video_input_limit`, `test_video_hold_early`, `test_windows_on_linux`, `test_xinput_thread`, `test_screensaver`, `test_bug_report` and `byte_compile_tracked` (it needs git, which can't read this worktree from WSL; it passes on Windows). The 30th, `test_menu_env_overrides`, cuts `save()` and lacked a stand-in for the new `game_language_choice`: it has one now and passes. Every check that reads a changed file (`run_all.py --changed`, 38) passes, plus `test_game_language`, `test_options_path`, `test_settings_atomic`, `test_menu_i18n_count` and `test_menu_restart`. The builder's new `an_update_keeps_the_language_chosen_in_the_game` passes, and `cargo clippy -p build-driver` is clean. After review (b3cbc4d59): `test_game_language` gained the review's cases (the row's choice put back when the save cannot write the settings, a failed read in the one-time copy, the runner's `{cc}`/`{cxx}`); they fail on the pre-review head 339f528f6 for those reasons and pass here (gcc and clang). The builder's new end-to-end `an_update_from_an_older_game_keeps_the_language_its_menu_chose` (driver.rs: a flat older folder, a profile with no `settings.ini`, then a second update) fails on 339f528f6 (`left: None`) and passes here; `cargo test -p build-driver` (160 + 7 + 4 passed), `cargo clippy -p build-driver --all-targets -D warnings` and `cargo fmt --check -p build-driver` are clean. Every check `run_all.py --changed` picks (142 with `--no-skip --strict`), on WSL Ubuntu 24.04: 116 passed, 7 failed, 19 skipped (no cargo, cmake, spirv-val or Vulkan headers there); the 7 are in the main-failing list above (`test_crt_options`, `test_upscaler_round_trip`, `test_pipeline_tour`, `test_menu_keys`, `test_input_background`, `test_bug_report`, `byte_compile_tracked`). ruff passes on the changed Python. `check_guide_screenshots.py --review-sources` and `test_guide_screenshots.py` pass: `settings-graphics.png` is kept, its review recorded (Graphics, Audio and Controls rendered with the UI-only helper from main and from 4d6d3547 differ only in the version text's box). `cargo fmt --check` flags only `build-compile/src/host_sources_tests.rs`, which main flags too. The changed C and C++ files built whole in the pack (llvm-mingw, Windows). After the second review (9f1b01617): an older folder's `language.txt` counts as the menu's only when it is newer than the folder's build record. `an_update_keeps_the_language_chosen_in_the_game` and `an_update_from_an_older_game_keeps_the_language_its_menu_chose` now cover a player who never chose: a `language.txt` the older build wrote, then an update with another language, writes no `game_language=`. They fail on b3cbc4d59 for that (`the build's own language.txt`, and a `settings.ini` written) and pass here. `cargo test -p build-driver` (160 + 7 + 4 passed), clippy (`-D warnings`) and `cargo fmt --check` are clean. Only the builder changed, so the game run above still holds. After futondestroyer's review (c8b4ec305, rebased on main f14a5664d): three new cases fail on 9f1b01617 for the review's reasons and pass here. `a_menu_choice_is_kept_when_the_first_update_asks_for_the_same_language` (driver.rs: a menu choice of zh-Hans, a first update asking for zh-Hans, then a second asking for en-US; on 9f1b01617 the profile got nothing, `left: None`). `test_game_language`: a profile `settings.ini` that can't be read (a folder in its place) is left alone, with no copy tried (on 9f1b01617 the copy was tried over it). And with no choice, the row's `language.txt` fallback is read once (on 9f1b01617 a change to the file showed at the next frame). `cargo test -p build-driver` (160 + 8 + 4 passed), `cargo clippy -p build-driver --all-targets --no-deps -D warnings` (without `--no-deps`, clippy now stops on main's `build-compile`, from #2782) and `cargo fmt --check` are clean. Every check `run_all.py --changed` picks (144), on WSL: 117 passed, 8 failed, 19 skipped; the 8 fail the same way on main: the 7 above and `test_keyboard_option` (new on main with #152, failing there with "the host cannot see the Keyboard row"). The guide check passes again: rendered from main f14a5664 and from b7f2825c, the pages differ only in the version text's box, recorded in the manifest. In the game, @ c8b4ec305 over the shared base, through the queue: the throwaway profile with only `game_language=zh-Hans` gave `oe: language zh-Hans (game_language in the settings)`, `Mals/CNzh`, the game folder's settings copied in once with the one line kept, and `stop: close work done`. A profile whose `settings.ini` was a folder gave `options: ...settings.ini could not be read: left as it is, the game folder's settings not put over it`, the game in `language.txt`'s English, the folder untouched, and a clean stop. Rebased on main b6d274d77 (9ef12bc71); this PR's commits are unchanged, and #2790 and #2803 touch only the Linux profiler and the Linux display, so the game run at c8b4ec305 still holds. `mise run test` on Windows (llvm-mingw, MSYS2's gcc, g++, glslang and spirv-val on PATH) @ 283a779de, on main 01539efd2: 807 passed, 48 failed, 47 skipped. 46 of the 48 fail the same way on main 01539efd2 on this PC. The other 2, `test_dev_ab` and `test_present_semaphores`, read none of this PR's files, pass on main and pass here when run alone: they failed under the full run's load. `test_game_language`, `test_options_path`, `test_settings_atomic` and `test_menu_env_overrides` pass on Windows at 9ef12bc71. After removing `language.txt` (the maintainer's call; 6b5b4151b, on main b6d274d77): the new cases fail on 9ef12bc71 and pass here. In `test_game_language`: no template is written at the start, and a leftover is moved once, kept under a choice, removed, and makes a settings file when there is none. In driver.rs: a build writes no `language.txt` and seeds a profile with no choice, `--language` without a profile goes into `config/settings.ini`, and a choice is never written over. play.rs: the key no longer holds the language. verify.rs: a leftover is reported as an extra. `cargo test -p build-driver` (160 + 9 + 4), `-p launcher-profile`, clippy (`--no-deps -D warnings`) and `cargo fmt --check` pass. `-p longshot-builder` has 6 failures and `-p build-compile` 2 toolchain ones, the same that fail on main b6d274d77 on this PC. `mise run test` (Windows, MSYS2's tools on PATH): 811 passed, 45 failed, 47 skipped; all 45 are among the 48 of the run above, which fail on main but for its 2 load flakes. The guide check passes, the pages rendering as on main but for the version text. In the game (Windows 11, RTX 5080, NVIDIA 621.40, the branch as a pack over the shared base, through the queue, headless): - A profile with no settings over a game folder with a leftover zh-Hans `language.txt`: `options: ...config/language.txt's language zh-Hans moved into ...settings.ini (game_language=)`, `oe: language zh-Hans (game_language in the settings)`, `Mals/CNzh`. The leftover was gone afterwards, the profile kept `game_language=zh-Hans`, and the run stopped cleanly. - A profile with `game_language=ja`: `oe: language ja (game_language in the settings)`, `Mals/JPja`, a clean stop. **Still to test:** - Windows, by hand: a version built by a game from before this PR, its language changed to 简体中文 in the game's menu, then updated from the launcher to a build of this PR with English named. Expecting the profile's `settings.ini` to gain `game_language=zh-Hans` (the builder's log line `the game's language chosen in its menu (zh-Hans) kept in .../settings.ini (game_language)`, naming the profile's settings.ini, and no `language.txt` left in the game folder). The same with the update asking for 简体中文, then a second one asking for English: the profile keeps `game_language=zh-Hans` and the game to start in Chinese. - Linux: the same profile run as above, expecting `oe: language zh-Hans (game_language in the settings)` (@Beanstalk run a build of this PR on Linux with a profile whose settings.ini holds only game_language=zh-Hans over a language.txt of en-US; expect the game in Chinese and that log line). ## Measurements Nothing to measure: the language is read once at the start, and the settings line is written only when the Game language row is left. ## Risks - A player who never chose a language sees the same language: their next build puts the build's language in their settings as `game_language=`, and that is what the game reads. - A player who chose one in the game's menu before this keeps it: the first update to this copies it into the profile's settings, whatever language that update asks for. - That first update tells a menu choice from the build's own language by time: only a `language.txt` written after the folder's build record counts. One case it can still misread: an older builder rebuilt the folder for a new language and changed nothing else (so it left the record unwritten), and this update names yet another one. Then the folder's language is kept once. With the launcher PR, the launcher writes the update's language over it after the build when the player chose one in the wizard. Later updates aren't affected: the folder then has the `game_language` feature. - Once chosen, the language follows the profile. The launcher's update wizard no longer changes it on its own (the launcher PR keeps its field and the profile's choice the same). `HOS_LANGUAGE` still overrides it for one run. - An older game build would fall back to English: it reads only `language.txt`, which builds no longer write. The new launcher plays only builds of a builder that has `game_language=` (the maintainer's call). - A revert leaves the language in the settings, where the reverted game doesn't look; an older build would fall back to English until a build writes `language.txt` again. ## Checklist ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. - [x] `mise run test` passes (any failure that also fails on `main` is named). - [x] Measured against `main`, or Measurements says why there is nothing to measure. - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. ### When it applies - [x] A fix: a game-free test that fails on `main` and passes here. - [x] A check under `tests/` that reads changed source is updated, not weakened. - [x] Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. - [x] Docs updated. - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. ### Ready to merge - [ ] Everything in Still to test has run, its results in Tested. - [ ] Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). - [ ] Approved in review, every comment answered. - [ ] CI passes on the head; on current `main`, measured again or a comment says why the numbers still hold. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
A player's game went back to English at each launcher update: the update writes language.txt into the game
folder with the language the launcher passed, over the one chosen in the game's menu. The language belongs
with the player's other settings (the profile's settings.ini), which no build writes. This test fails on
main: the game reads language.txt alone, the menu row writes it there, and a profile file holding only the
launcher's game_language= stops the one-time copy of the game folder's settings.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
fix(menu): the game's language is kept with the player's settings, so an update keeps it
Some checks failed
CI / What the change needs (pull_request) Successful in 12s
CI / Third-party parts and guide screenshots (pull_request) Failing after 16s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Failing after 19s
PR description / Title and description (pull_request_target) Successful in 6s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
339f528f6e
The Game language row wrote language.txt in the game folder, which every build writes again with the
language it is asked for: a launcher update set a Chinese game back to English. The choice is now the
settings' game_language= (the profile's settings.ini, which no build writes), and the game reads it over
language.txt; HOS_LANGUAGE still wins over both, and language.txt stays the build's language until the
player chooses one.

- host/nn_applet.c: HOS_LANGUAGE, else the settings' game_language, else language.txt; the log line says
  which (oe: language zh-Hans (game_language in the settings)).
- gpu/vk/vk_menu_i18n.cpp, vk_menu.cpp: the same rule for the menu; the row's choice is saved with the
  settings when the row is left, and language.txt is left as the build wrote it. A file with only
  game_language= is still a first start (Auto (this PC) chooses).
- host/options_path.c: a profile's settings.ini with only game_language= (the launcher can write it before
  the game ever started with that profile) still gets the game folder's settings copied in once, the
  line kept.
- builder: before a build writes language.txt over another language a game from before kept there (the
  player's choice in its menu), that language goes into the profile's settings.ini as game_language=
  when it has none, so the first update to this keeps it too.
- The Menu language row's Auto hint no longer names language.txt (13 translations shortened to match);
  the player and developer docs say where the language is kept.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Member

Tested in game: Windows 11, RTX 5080, NVIDIA 621.40: the branch as a pack over the shared base, a headless run with a throwaway profile whose settings.ini holds only game_language=zh-Hans over a build whose language.txt says en-US. Here: oe: language zh-Hans (game_language in the settings), the Chinese text pack (Mals/CNzh) opened, a clean stop, and the game's own settings save kept the line. main @ 3ab4db6e9, same setup: oe: language en-US (language.txt), Mals/USen.

Tested in game: Windows 11, RTX 5080, NVIDIA 621.40: the branch as a pack over the shared base, a headless run with a throwaway profile whose settings.ini holds only game_language=zh-Hans over a build whose language.txt says en-US. Here: oe: language zh-Hans (game_language in the settings), the Chinese text pack (Mals/CNzh) opened, a clean stop, and the game's own settings save kept the line. main @ 3ab4db6e9, same setup: oe: language en-US (language.txt), Mals/USen.
Member

Possibly related, for context:

  • issue #230 Idea: please let me change the F1 menu Language after it has been built (discord Idea) — Requests changing the game's language in the menu; this keeps that choice across updates.
Possibly related, for context: - issue #230 Idea: please let me change the F1 menu Language after it has been built (discord Idea) — Requests changing the game's language in the menu; this keeps that choice across updates.
llun changed title from WIP: fix(menu): the game's language is kept with the player's settings, so an update keeps it to fix(menu): the game's language is kept with the player's settings, so an update keeps it 2026-11-29 07:04:24 +00:00
Author
Member
@review
BeanBot requested changes 2026-11-29 07:16:06 +00:00
Dismissed
BeanBot left a comment

Recommendation: Request changes. The normal settings override works in the recorded Windows run, but migration can still lose an existing language choice, and a failed settings save is reported as successful. The migration also treats a build default as a player choice.

The change stores the game language with profile settings so later builds can preserve it. It adds a migration for older builds, but that migration needs to distinguish and preserve existing choices reliably.

Blocking (5): must change before merging.

  1. L1 builder/crates/build-driver/src/folder.rs:650: The migration skips a profile without a settings file, even though its old language exists only in language.txt. (more on the line) Do: Preserve the old language when settings.ini is absent too, while retaining the later carry of the game folder's other settings.
  2. L2 builder/crates/build-driver/src/build.rs:737: The old language is looked up after the new organized installation has been swapped in, so a flat installation's language is missed. (more on the line) Do: Read and retain the old folder language before the installation changes its layout, and use that value for migration.
  3. L3 builder/crates/build-driver/src/folder.rs:646: A different build language is assumed to be a menu choice, although language.txt also holds the original build default. (more on the line) Do: Use reliable evidence of an explicit older choice, or settle the ambiguity with a migration policy that does not silently convert every old build default into a permanent preference.
  4. L8: The check CI / Third-party parts and guide screenshots (pull_request) fails on this head and passes on the base branch: Failing after 16s.
  5. L9: The check CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) fails on this head and passes on the base branch: Failing after 19s.

Should fix (3): not blocking, but worth doing before merging.

  • L4 gpu/vk/vk_menu.cpp:5037: The row records and reports the new language even when saving the settings fails. (more on the line) Do: Have the save operation report failure and restore the previous choice and row on failure, with an appropriate message.
  • L5 host/options_path.c:119: The migration treats a read error as end of file and can atomically replace the profile with a partial copy. (more on the line) Do: Check ferror before writing the destination, discard the partial buffer on failure, and leave the existing profile file intact.
  • L6 tests/test_game_language.py:31: The new check hard-codes gcc and g++ instead of using the runner's selected compilers. (more on the line) Do: Use the runner's {cc} and {cxx} arguments and its compiler command handling.

Testing before merging (1) (runs on the systems it can change; it doesn't hold the recommendation)

  • L7: The first update from an older game and the Linux profile path still need their recorded runs. When: The existing Windows run starts with game_language already in settings.ini, so it does not exercise the builder migration or the Linux host path. Do: Run the described old-game update on Windows and the settings override on Linux, recording the resulting language and settings.

@fix can do L1, L2, L3, L4, L5, L6, L8 and L9.

Questions (1) (not confirmed from the code; they don't hold the recommendation)

  • tests/test_game_language.py:228: Is there a current case where the save path fails to persist a valid choice, beyond the separately reported failed-save case?

Checks: Still running: 7 checks.

More: does it help, other systems, switches, what was read

Does it help: Unproven for the reported update path. The recorded Windows comparison shows zh-Hans overriding an en-US build and surviving a settings save; the update from an older build has not yet been run.

Other systems: The host and builder paths affect Windows and Linux, including Steam Deck. The recorded run covers Windows; the Linux profile run and the old-build update remain outstanding. The change does not alter rendering or GPU-specific behavior.

Switches: No switches added, changed or removed. HOS_LANGUAGE retains its existing precedence.

Reviewed: 339f528f6e against 01d6878b3f: Read AGENTS.md, CONTRIBUTING.md, the PR template, standards, the diff and commit messages; traced the changed language, settings, builder and test paths and their callers. Skimmed translations, documentation changes and recorded runs. The large unchanged portions of changed source files and generated translation tables were not read in full; docs/review-checklist.md was absent. Overlapping pull requests could not be checked offline.; nothing run (a code review).

Checked and fine:

  • The recorded Windows run demonstrates the settings language overriding language.txt and being retained by a settings save.
  • Both commits record AI assistance. No renderer API version or switch table change is required by this diff.
  • The changed translation entries consistently shorten the Auto hint.

Testing: No code or tests were run during review. The PR reports a Windows game run and game-free checks; CI has two head-only failures and several checks still running.

Overlaps and merge order: The description identifies LongshotLauncher#364 as the companion launcher change; its merge order and other overlaps could not be checked offline.


Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.

**Recommendation: Request changes.** The normal settings override works in the recorded Windows run, but migration can still lose an existing language choice, and a failed settings save is reported as successful. The migration also treats a build default as a player choice. The change stores the game language with profile settings so later builds can preserve it. It adds a migration for older builds, but that migration needs to distinguish and preserve existing choices reliably. **Blocking (5)**: must change before merging. 1. **L1** `builder/crates/build-driver/src/folder.rs:650`: The migration skips a profile without a settings file, even though its old language exists only in language.txt. (more on the line) **Do:** Preserve the old language when settings.ini is absent too, while retaining the later carry of the game folder's other settings. 2. **L2** `builder/crates/build-driver/src/build.rs:737`: The old language is looked up after the new organized installation has been swapped in, so a flat installation's language is missed. (more on the line) **Do:** Read and retain the old folder language before the installation changes its layout, and use that value for migration. 3. **L3** `builder/crates/build-driver/src/folder.rs:646`: A different build language is assumed to be a menu choice, although language.txt also holds the original build default. (more on the line) **Do:** Use reliable evidence of an explicit older choice, or settle the ambiguity with a migration policy that does not silently convert every old build default into a permanent preference. 4. **L8**: The check `CI / Third-party parts and guide screenshots (pull_request)` fails on this head and passes on the base branch: Failing after 16s. 5. **L9**: The check `CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request)` fails on this head and passes on the base branch: Failing after 19s. **Should fix (3)**: not blocking, but worth doing before merging. - **L4** `gpu/vk/vk_menu.cpp:5037`: The row records and reports the new language even when saving the settings fails. (more on the line) **Do:** Have the save operation report failure and restore the previous choice and row on failure, with an appropriate message. - **L5** `host/options_path.c:119`: The migration treats a read error as end of file and can atomically replace the profile with a partial copy. (more on the line) **Do:** Check ferror before writing the destination, discard the partial buffer on failure, and leave the existing profile file intact. - **L6** `tests/test_game_language.py:31`: The new check hard-codes gcc and g++ instead of using the runner's selected compilers. (more on the line) **Do:** Use the runner's {cc} and {cxx} arguments and its compiler command handling. **Testing before merging (1)** (runs on the systems it can change; it doesn't hold the recommendation) - **L7**: The first update from an older game and the Linux profile path still need their recorded runs. *When:* The existing Windows run starts with game_language already in settings.ini, so it does not exercise the builder migration or the Linux host path. **Do:** Run the described old-game update on Windows and the settings override on Linux, recording the resulting language and settings. `@fix` can do L1, L2, L3, L4, L5, L6, L8 and L9. **Questions (1)** (not confirmed from the code; they don't hold the recommendation) - `tests/test_game_language.py:228`: Is there a current case where the save path fails to persist a valid choice, beyond the separately reported failed-save case? **Checks:** Still running: 7 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven for the reported update path. The recorded Windows comparison shows zh-Hans overriding an en-US build and surviving a settings save; the update from an older build has not yet been run. **Other systems:** The host and builder paths affect Windows and Linux, including Steam Deck. The recorded run covers Windows; the Linux profile run and the old-build update remain outstanding. The change does not alter rendering or GPU-specific behavior. **Switches:** No switches added, changed or removed. HOS_LANGUAGE retains its existing precedence. **Reviewed:** 339f528f6e05 against 01d6878b3f14: Read AGENTS.md, CONTRIBUTING.md, the PR template, standards, the diff and commit messages; traced the changed language, settings, builder and test paths and their callers. Skimmed translations, documentation changes and recorded runs. The large unchanged portions of changed source files and generated translation tables were not read in full; docs/review-checklist.md was absent. Overlapping pull requests could not be checked offline.; nothing run (a code review). **Checked and fine:** - The recorded Windows run demonstrates the settings language overriding language.txt and being retained by a settings save. - Both commits record AI assistance. No renderer API version or switch table change is required by this diff. - The changed translation entries consistently shorten the Auto hint. **Testing:** No code or tests were run during review. The PR reports a Windows game run and game-free checks; CI has two head-only failures and several checks still running. **Overlaps and merge order:** The description identifies LongshotLauncher#364 as the companion launcher change; its merge order and other overlaps could not be checked offline. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.</sub>
@ -734,1 +734,4 @@
}
// (the language the player chose in the game, which a game from before kept in language.txt alone: into the profile's
// settings first, which the game reads over language.txt, so this build's language.txt does not undo it)
if let Some(profile) = &o.profile
Member

L2 (blocking): The old language is looked up after the new organized installation has been swapped in, so a flat installation's language is missed.

When: An older flat game has language.txt at its root. After installation creates data/image.bin, folder_language selects config/language.txt instead; the builder then writes the requested language there and the player's old choice is lost.

Do: Read and retain the old folder language before the installation changes its layout, and use that value for migration.

**L2** (blocking): The old language is looked up after the new organized installation has been swapped in, so a flat installation's language is missed. *When:* An older flat game has language.txt at its root. After installation creates data/image.bin, folder_language selects config/language.txt instead; the builder then writes the requested language there and the player's old choice is lost. **Do:** Read and retain the old folder language before the installation changes its layout, and use that value for migration.
@ -637,0 +643,4 @@
/// the file has a game_language= already (the player's choice since), nor when the profile has no settings yet (the game
/// copies a game folder's into it once, host/options_path.c). Whether it was put there.
pub fn keep_chosen_language(out: &Path, profile: &Path, language: &str) -> Result<bool> {
let Some(chosen) = folder_language(out).filter(|chosen| *chosen != language) else {
Member

L3 (blocking): A different build language is assumed to be a menu choice, although language.txt also holds the original build default.

When: A player who never changed the language rebuilds a French version with English requested. The migration writes game_language=fr, so the game stays French and subsequent builds cannot change it, contrary to the stated behavior for players who made no choice.

Do: Use reliable evidence of an explicit older choice, or settle the ambiguity with a migration policy that does not silently convert every old build default into a permanent preference.

**L3** (blocking): A different build language is assumed to be a menu choice, although language.txt also holds the original build default. *When:* A player who never changed the language rebuilds a French version with English requested. The migration writes game_language=fr, so the game stays French and subsequent builds cannot change it, contrary to the stated behavior for players who made no choice. **Do:** Use reliable evidence of an explicit older choice, or settle the ambiguity with a migration policy that does not silently convert every old build default into a permanent preference.
@ -637,0 +647,4 @@
return Ok(false);
};
let settings = profile.join(launcher_profile::SETTINGS);
let Ok(text) = std::fs::read_to_string(&settings) else {
Member

L1 (blocking): The migration skips a profile without a settings file, even though its old language exists only in language.txt.

When: A player updates an older game with zh-Hans in language.txt using a profile that has no settings.ini. This returns false, the build writes en-US, and the later settings carry cannot recover the old language.

Do: Preserve the old language when settings.ini is absent too, while retaining the later carry of the game folder's other settings.

**L1** (blocking): The migration skips a profile without a settings file, even though its old language exists only in language.txt. *When:* A player updates an older game with zh-Hans in language.txt using a profile that has no settings.ini. This returns false, the build writes en-US, and the later settings carry cannot recover the old language. **Do:** Preserve the old language when settings.ini is absent too, while retaining the later carry of the game folder's other settings.
@ -5030,2 +5034,4 @@
menu_refresh = true;
return;
}
save();
Member

L4 (should fix): The row records and reports the new language even when saving the settings fails.

When: With a read-only settings file, set_game_language changes the in-memory choice and save returns without writing. The row and log still say the new language will be used, but a restart loads the old one; unlike the previous implementation, the row does not revert.

Do: Have the save operation report failure and restore the previous choice and row on failure, with an appropriate message.

**L4** (should fix): The row records and reports the new language even when saving the settings fails. *When:* With a read-only settings file, set_game_language changes the in-memory choice and save returns without writing. The row and log still say the new language will be used, but a restart loads the old one; unlike the previous implementation, the row does not revert. **Do:** Have the save operation report failure and restore the previous choice and row on failure, with an appropriate message.
@ -100,0 +116,4 @@
if (!f) return 0;
size_t cap = 1 << 16, n = 0;
char *text = (char *)malloc(cap);
for (size_t got; text && (got = fread(text + n, 1, cap - n, f)) > 0;) {
Member

L5 (should fix): The migration treats a read error as end of file and can atomically replace the profile with a partial copy.

When: If reading the old settings fails after some bytes, fread returns zero and copy_adding writes the partial contents plus game_language to settings.ini. The next start sees settings there and never retries the missing choices.

Do: Check ferror before writing the destination, discard the partial buffer on failure, and leave the existing profile file intact.

**L5** (should fix): The migration treats a read error as end of file and can atomically replace the profile with a partial copy. *When:* If reading the old settings fails after some bytes, fread returns zero and copy_adding writes the partial contents plus game_language to settings.ini. The next start sees settings there and never retries the missing choices. **Do:** Check ferror before writing the destination, discard the partial buffer on failure, and leave the existing profile file intact.
@ -0,0 +28,4 @@
from srccut import between, block # noqa: E402
RUN_ALL_ARGS = ["--cc", "gcc", "--cxx", "g++"]
ROOT = Path(__file__).resolve().parents[1]
Member

L6 (should fix): The new check hard-codes gcc and g++ instead of using the runner's selected compilers.

When: On a supported machine configured with CC and CXX but without executables named gcc and g++, run_all skips this check even when suitable compilers are available.

Do: Use the runner's {cc} and {cxx} arguments and its compiler command handling.

**L6** (should fix): The new check hard-codes gcc and g++ instead of using the runner's selected compilers. *When:* On a supported machine configured with CC and CXX but without executables named gcc and g++, run_all skips this check even when suitable compilers are available. **Do:** Use the runner's {cc} and {cxx} arguments and its compiler command handling.
BeanBot's review of the pull request found cases the change got wrong. These checks fail on its head
(and on main, for the original bug):
- builder: an update from an older game's flat folder (language.txt at its root, as its menu last
  wrote it) for a profile with no settings.ini yet keeps the menu's language in a new settings.ini;
  and the next update, of a folder whose game has game_language=, does not take the build's own
  language.txt for a choice (driver.rs, folder.rs).
- gpu/vk/vk_menu.cpp game_lang_tick: when the settings' save cannot write the file (a read-only one),
  the choice and the row go back to what the next start will use.
- host/options_path.c copy_adding: a read of the game folder's settings that fails part way leaves
  the profile's file as it was, not a cut copy.
- tests/test_game_language.py takes run_all's {cc} and {cxx} (tests/compiler_command.py) instead of
  naming gcc and g++.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
From BeanBot's review of the pull request:
- builder (folder.rs menu_language, keep_chosen_language; build.rs): the old language.txt is read
  before the install, so a flat folder's counts too; a profile with no settings.ini gets one with the
  game_language= line alone (the game still copies the game folder's settings into it once); and only
  a folder whose record lacks the new game_language feature (game/features.txt) is taken for one whose
  menu wrote language.txt. So a build's own language is taken for a choice at most once, on the first
  update to a game with game_language=; a launcher that knows the line (LongshotLauncher#364) writes
  the build's language over it after that build when it was asked for another.
- gpu/vk/vk_menu.cpp game_lang_tick: the choice is read back from the settings file after the save
  (vk_menu_i18n.cpp game_language_saved); when it is not there (a read-only file, a full disk), the
  choice and the row go back (game_language_restore) and the log says so.
- host/options_path.c copy_adding: a read error part way (ferror) writes nothing.
- tests/test_settings_atomic.py: an unused import ruff flags once the file is changed (main has it too).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
docs(guide): settings-graphics.png kept after the language change, its review recorded
Some checks failed
CI / What the change needs (pull_request) Successful in 9s
CI / Third-party parts and guide screenshots (pull_request) Successful in 13s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Successful in 14s
PR description / Title and description (pull_request_target) Successful in 5s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
b3cbc4d590
scripts/check_guide_screenshots.py --review-sources flagged settings-graphics.png: seven of its UI
sources changed (this pull request's menu files, and game/oot_cheat_items.h from #2785, which main
flags too). Rendered with the UI-only helper from main 01d6878b and from 4d6d3547, the Graphics,
Audio and Controls pages differ only in the version text's box, and the published image differs from
4d6d3547's render in that box alone: the hashes and a note are recorded, the PNG is unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Member

Thanks for the review. Fixed in 61b1cd862 (the tests, which fail on the old head 339f528f6) and 4d6d35476 (the fixes), plus b3cbc4d59 (the guide picture's review). Point by point:

  • L1 (no settings.ini in the profile): fixed. keep_chosen_language now writes a settings.ini holding only game_language=<code>. The game counts such a file as no settings yet, so it still copies the game folder's settings in once and keeps the line (host/options_path.c).
  • L2 (old language read after the install): fixed. build.rs now reads it with the new folder::menu_language right where language() reads the folder's language, before anything is installed, and passes it on. A flat folder's root language.txt counts.
  • L3 (a build's default taken for a menu choice): settled with evidence plus a policy. The game now has a game_language feature (game/features.txt, kept in the build record). Only a folder whose record lacks it can have a language.txt that its game's menu wrote. A game with game_language= never writes that file. So the migration happens at most once, on the first update to this version. After that, the folder's language.txt is the build's and is never taken for a choice. That first update still can't tell a menu choice from the build's default, because an older game left no mark. So it keeps the language the player has been playing in. With LongshotLauncher#364, the launcher writes the update's language over that line after the build when the player picked one in the wizard, so a deliberate change still wins. With an older launcher, a player who named a new language on purpose keeps the old one until they pick the new one in Gameplay → Game language. The Risks section says this.
  • L4 (row says saved when the save failed): fixed. game_lang_tick reads the line back from the settings file after save() (i18n::game_language_saved). If the line isn't there (a read-only file, a full disk, no settings file this run), the choice and the row go back (game_language_restore), and the log says menu: the settings could not be saved: the game language at the next start stays .... I kept save()'s signature, since 17 checks cut it as void save() {.
  • L5 (read error in the copy): fixed. copy_adding checks ferror and writes nothing when a read failed, so the profile's file stays as it was and the next start copies again.
  • L6 (hard-coded gcc/g++): fixed. RUN_ALL_ARGS = ["--cc", "{cc}", "--cxx", "{cxx}"], parsed with tests/compiler_command.py's parse_compiler, and the check skips when no compiler is found.
  • L7 (testing): still open, listed in Still to test. A new end-to-end driver test, an_update_from_an_older_game_keeps_the_language_its_menu_chose, runs the builder's update path on a flat older folder with a profile that has no settings.ini. A real update by hand and the Linux run still need their recorded runs.
  • L8 (Third-party parts and guide screenshots): the guide check flagged settings-graphics.png. Seven of its UI sources changed: this PR's menu files, and game/oot_cheat_items.h from #2785, which flags on main too. I rendered Graphics, Audio and Controls with the UI-only helper from main 01d6878b and from 4d6d3547. They differ only in the version text's box, and the published image differs from this head's render in that box alone. The hashes and a note are recorded in the manifest; the PNG is unchanged. check_guide_screenshots.py --review-sources and test_guide_screenshots.py pass, and so does check_third_party.py.
  • L9 (Lint): ruff's F401 on tests/test_settings_atomic.py: an unused import sys, which main has too and which shows once the file changes. Removed.
  • Question (another case where the save fails to keep a valid choice): none that I found. save() writes game_language= whenever there is a choice. Every way it can fail (read-only file, .new not made or not moved, a write error, no settings file this run) leaves the line unwritten, and the read-back now catches all of them.

Tested again in the game (Windows 11, RTX 5080, NVIDIA 621.40; b3cbc4d59 as a pack over the shared base, through the job queue, headless). A profile whose settings.ini held only game_language=zh-Hans, over a build whose language.txt says en-US, gave oe: language zh-Hans (game_language in the settings) and opened Mals/CNzh. The game folder's settings were copied into the profile once, with the one game_language=zh-Hans line kept, and the run stopped with stop: close work done.

Checks: test_game_language passes with gcc and with clang. cargo test -p build-driver passes, and clippy (-D warnings) and cargo fmt --check are clean. Of the 142 checks run_all.py --changed picks, run on WSL Ubuntu 24.04: 116 passed, 19 were skipped for missing tools, and 7 failed. All 7 fail on main the same way and are listed in the description.

Thanks for the review. Fixed in `61b1cd862` (the tests, which fail on the old head `339f528f6`) and `4d6d35476` (the fixes), plus `b3cbc4d59` (the guide picture's review). Point by point: - **L1** (no `settings.ini` in the profile): fixed. `keep_chosen_language` now writes a `settings.ini` holding only `game_language=<code>`. The game counts such a file as no settings yet, so it still copies the game folder's settings in once and keeps the line (`host/options_path.c`). - **L2** (old language read after the install): fixed. `build.rs` now reads it with the new `folder::menu_language` right where `language()` reads the folder's language, before anything is installed, and passes it on. A flat folder's root `language.txt` counts. - **L3** (a build's default taken for a menu choice): settled with evidence plus a policy. The game now has a `game_language` feature (`game/features.txt`, kept in the build record). Only a folder whose record lacks it can have a `language.txt` that its game's menu wrote. A game with `game_language=` never writes that file. So the migration happens at most once, on the first update to this version. After that, the folder's `language.txt` is the build's and is never taken for a choice. That first update still can't tell a menu choice from the build's default, because an older game left no mark. So it keeps the language the player has been playing in. With LongshotLauncher#364, the launcher writes the update's language over that line after the build when the player picked one in the wizard, so a deliberate change still wins. With an older launcher, a player who named a new language on purpose keeps the old one until they pick the new one in Gameplay → Game language. The Risks section says this. - **L4** (row says saved when the save failed): fixed. `game_lang_tick` reads the line back from the settings file after `save()` (`i18n::game_language_saved`). If the line isn't there (a read-only file, a full disk, no settings file this run), the choice and the row go back (`game_language_restore`), and the log says `menu: the settings could not be saved: the game language at the next start stays ...`. I kept `save()`'s signature, since 17 checks cut it as `void save() {`. - **L5** (read error in the copy): fixed. `copy_adding` checks `ferror` and writes nothing when a read failed, so the profile's file stays as it was and the next start copies again. - **L6** (hard-coded gcc/g++): fixed. `RUN_ALL_ARGS = ["--cc", "{cc}", "--cxx", "{cxx}"]`, parsed with `tests/compiler_command.py`'s `parse_compiler`, and the check skips when no compiler is found. - **L7** (testing): still open, listed in Still to test. A new end-to-end driver test, `an_update_from_an_older_game_keeps_the_language_its_menu_chose`, runs the builder's update path on a flat older folder with a profile that has no `settings.ini`. A real update by hand and the Linux run still need their recorded runs. - **L8** (Third-party parts and guide screenshots): the guide check flagged `settings-graphics.png`. Seven of its UI sources changed: this PR's menu files, and `game/oot_cheat_items.h` from #2785, which flags on main too. I rendered Graphics, Audio and Controls with the UI-only helper from main `01d6878b` and from `4d6d3547`. They differ only in the version text's box, and the published image differs from this head's render in that box alone. The hashes and a note are recorded in the manifest; the PNG is unchanged. `check_guide_screenshots.py --review-sources` and `test_guide_screenshots.py` pass, and so does `check_third_party.py`. - **L9** (Lint): ruff's F401 on `tests/test_settings_atomic.py`: an unused `import sys`, which main has too and which shows once the file changes. Removed. - **Question** (another case where the save fails to keep a valid choice): none that I found. `save()` writes `game_language=` whenever there is a choice. Every way it can fail (read-only file, `.new` not made or not moved, a write error, no settings file this run) leaves the line unwritten, and the read-back now catches all of them. **Tested again in the game** (Windows 11, RTX 5080, NVIDIA 621.40; `b3cbc4d59` as a pack over the shared base, through the job queue, headless). A profile whose `settings.ini` held only `game_language=zh-Hans`, over a build whose `language.txt` says `en-US`, gave `oe: language zh-Hans (game_language in the settings)` and opened `Mals/CNzh`. The game folder's settings were copied into the profile once, with the one `game_language=zh-Hans` line kept, and the run stopped with `stop: close work done`. **Checks:** `test_game_language` passes with gcc and with clang. `cargo test -p build-driver` passes, and clippy (`-D warnings`) and `cargo fmt --check` are clean. Of the 142 checks `run_all.py --changed` picks, run on WSL Ubuntu 24.04: 116 passed, 19 were skipped for missing tools, and 7 failed. All 7 fail on main the same way and are listed in the description.
Author
Member
@review
BeanBot left a comment

Recommendation: Request changes. The migration still treats an older build’s default language as a menu choice when it differs from the requested update language. The first-update and Linux profile runs also remain outstanding.

The change stores the game language with profile settings so later builds do not overwrite a player’s choice. It also migrates older choices, but the first migration can preserve a build default against an intentional language change.

Blocking (1): must change before merging.

  1. L3 builder/crates/build-driver/src/folder.rs:646: A different build language is assumed to be a menu choice, although language.txt also holds the original build default. When: A player who never changed the language rebuilds a French version with English requested. The migration writes game_language=fr, so the game stays French and subsequent builds cannot change it, contrary to the stated behavior for players who made no choice. Do: Use reliable evidence of an explicit older choice, or settle the ambiguity with a migration policy that does not silently convert every old build default into a permanent preference.

Testing before merging (1) (runs on the systems it can change; it doesn't hold the recommendation)

  • L7: The first update from an older game and the Linux profile path still need their recorded runs. When: The existing Windows run starts with game_language already in settings.ini, so it does not exercise the builder migration or the Linux host path. Do: Run the described old-game update on Windows and the settings override on Linux, recording the resulting language and settings.

@fix can do L3.

Since the last review (on 339f528f6e)
Resolved: L1 (The migration skips a profile without a settings file, even though its old language exists…); L2 (The old language is looked up after the new organized installation has been swapped in, so…); L4 (The row records and reports the new language even when saving the settings fails.); L5 (The migration treats a read error as end of file and can atomically replace the profile wi…); L6 (The new check hard-codes gcc and g++ instead of using the runner's selected compilers.); L8 (The check CI / Third-party parts and guide screenshots (pull_request) fails on this head…); L9 (The check CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) fails on this he…)
Still open: L3 (A different build language is assumed to be a menu choice, although language.txt also hold…); L7 (The first update from an older game and the Linux profile path still need their recorded r…)

Checks: Still running: 7 checks.

More: does it help, other systems, switches, what was read

Does it help: Yes, for the tested profile path: the reported Windows run selected zh-Hans and opened the Chinese text pack over an en-US build; main selected en-US. The end-to-end first update and Linux profile run remain unverified in game.

Other systems: The builder migration affects older flat and organized installations and profile settings. The game and menu read the setting on Windows and Linux; Windows was reported tested, while the Linux profile run remains outstanding.

Switches: No switches added, changed or removed. HOS_LANGUAGE remains an override.

Reviewed: b3cbc4d590 against 01d6878b3f: Read the repository rules and PR template, the changes since the ledger for the affected implementation and test, and host/options_path.c in full. Inspected the relevant builder and menu language paths and commit list; the other changed files and full base diff were not read in full.; nothing run (a code review).

Checked and fine:

  • The failed-copy path frees its buffer before returning without writing.
  • The fix retains the intended profile-language behavior and reads the old flat-folder language before installation.

Testing: No commands that build or run project code were executed. The PR reports Windows game and builder test results; the first-update and Linux game runs remain outstanding, and CI is still running.

Overlaps and merge order: LongshotLauncher#364 writes the same profile setting and changes the update wizard’s language behavior.


Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.

**Recommendation: Request changes.** The migration still treats an older build’s default language as a menu choice when it differs from the requested update language. The first-update and Linux profile runs also remain outstanding. The change stores the game language with profile settings so later builds do not overwrite a player’s choice. It also migrates older choices, but the first migration can preserve a build default against an intentional language change. **Blocking (1)**: must change before merging. 1. **L3** `builder/crates/build-driver/src/folder.rs:646`: A different build language is assumed to be a menu choice, although language.txt also holds the original build default. *When:* A player who never changed the language rebuilds a French version with English requested. The migration writes game_language=fr, so the game stays French and subsequent builds cannot change it, contrary to the stated behavior for players who made no choice. **Do:** Use reliable evidence of an explicit older choice, or settle the ambiguity with a migration policy that does not silently convert every old build default into a permanent preference. **Testing before merging (1)** (runs on the systems it can change; it doesn't hold the recommendation) - **L7**: The first update from an older game and the Linux profile path still need their recorded runs. *When:* The existing Windows run starts with game_language already in settings.ini, so it does not exercise the builder migration or the Linux host path. **Do:** Run the described old-game update on Windows and the settings override on Linux, recording the resulting language and settings. `@fix` can do L3. **Since the last review** (on 339f528f6e05) Resolved: L1 (The migration skips a profile without a settings file, even though its old language exists…); L2 (The old language is looked up after the new organized installation has been swapped in, so…); L4 (The row records and reports the new language even when saving the settings fails.); L5 (The migration treats a read error as end of file and can atomically replace the profile wi…); L6 (The new check hard-codes gcc and g++ instead of using the runner's selected compilers.); L8 (The check `CI / Third-party parts and guide screenshots (pull_request)` fails on this head…); L9 (The check `CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request)` fails on this he…) Still open: L3 (A different build language is assumed to be a menu choice, although language.txt also hold…); L7 (The first update from an older game and the Linux profile path still need their recorded r…) **Checks:** Still running: 7 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Yes, for the tested profile path: the reported Windows run selected zh-Hans and opened the Chinese text pack over an en-US build; main selected en-US. The end-to-end first update and Linux profile run remain unverified in game. **Other systems:** The builder migration affects older flat and organized installations and profile settings. The game and menu read the setting on Windows and Linux; Windows was reported tested, while the Linux profile run remains outstanding. **Switches:** No switches added, changed or removed. HOS_LANGUAGE remains an override. **Reviewed:** b3cbc4d59086 against 01d6878b3f14: Read the repository rules and PR template, the changes since the ledger for the affected implementation and test, and host/options_path.c in full. Inspected the relevant builder and menu language paths and commit list; the other changed files and full base diff were not read in full.; nothing run (a code review). **Checked and fine:** - The failed-copy path frees its buffer before returning without writing. - The fix retains the intended profile-language behavior and reads the old flat-folder language before installation. **Testing:** No commands that build or run project code were executed. The PR reports Windows game and builder test results; the first-update and Linux game runs remain outstanding, and CI is still running. **Overlaps and merge order:** LongshotLauncher#364 writes the same profile setting and changes the update wizard’s language behavior. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.</sub>
BeanBot's second review (L3): on the first update to a game with game_language=, a folder's
language.txt that names another language than the one asked for was taken for a choice in the older
game's menu, though the build that made the folder wrote it too: a player who never chose stayed in
the old language. The build writes the folder's record after language.txt, and only the game writes
language.txt after that, so a language.txt no newer than the record is the build's own. These cases
fail on the head: such a folder, and one with no record, give no menu language, and an update of it
writes no game_language= into the profile (folder.rs, driver.rs).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
fix(builder): only a language.txt written after the folder's last build is taken for a menu choice
Some checks failed
CI / What the change needs (pull_request) Successful in 9s
CI / Third-party parts and guide screenshots (pull_request) Successful in 12s
PR description / Title and description (pull_request_target) Successful in 7s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Successful in 15s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
9f1b01617d
BeanBot's second review (L3): the first update to a game with game_language= took any language.txt
that named another language than the one asked for as the player's choice in the older game's menu,
though the build that made the folder wrote its own language there too. menu_language now also needs
language.txt to be newer than the folder's build record: a build writes the record after language.txt
(the install's note, the finish), and nothing but a build writes the record, so a newer language.txt
was written by the game, and one no newer is the build's, which the player never chose. A folder with
no record has nothing to tell them apart by, and is left alone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Member

Thanks. L3 is fixed in 18f48bbac (the tests, which fail on b3cbc4d59) and f834d8aec (the fix); the head is 9f1b01617.

L3: the migration now has evidence of a choice, not only a feature gate. A build writes the folder's build record (longshot_build.json) after language.txt: the install's note, then the finish. Nothing but a build writes the record, and a plain play doesn't. So a language.txt newer than the record was written after the last build, which only the game's menu did. One no newer is the build's own language, and it's left alone. folder::menu_language checks this after the game_language feature gate. A folder with no record has nothing to compare against, so it's left alone too.

Your case, a player who never changed the language rebuilding a French version with English asked for: the French language.txt was written by the build, before its record. So no game_language= is written, and the update's English becomes the game's language. The builder's unit test and the driver test cover that case now, along with the menu-choice case.

What's left: an older builder that rebuilt a folder for a new language and changed nothing else leaves the record unwritten, because it's written only when it changes. If this first update then names yet another language, that older rebuild's language is kept once. That takes two language changes through the launcher with nothing else in between. LongshotLauncher#364 then writes the wizard's language over it after the build. The Risks section says so.

L7: unchanged, still in Still to test.

Checks: cargo test -p build-driver passes (160 + 7 + 4), and clippy (-D warnings) and cargo fmt --check are clean. Only the builder changed in this round, so the game run in my last reply still holds.

Thanks. L3 is fixed in `18f48bbac` (the tests, which fail on `b3cbc4d59`) and `f834d8aec` (the fix); the head is `9f1b01617`. **L3:** the migration now has evidence of a choice, not only a feature gate. A build writes the folder's build record (`longshot_build.json`) after `language.txt`: the install's note, then the finish. Nothing but a build writes the record, and a plain play doesn't. So a `language.txt` newer than the record was written after the last build, which only the game's menu did. One no newer is the build's own language, and it's left alone. `folder::menu_language` checks this after the `game_language` feature gate. A folder with no record has nothing to compare against, so it's left alone too. Your case, a player who never changed the language rebuilding a French version with English asked for: the French `language.txt` was written by the build, before its record. So no `game_language=` is written, and the update's English becomes the game's language. The builder's unit test and the driver test cover that case now, along with the menu-choice case. What's left: an older builder that rebuilt a folder for a new language and changed nothing else leaves the record unwritten, because it's written only when it changes. If this first update then names yet another language, that older rebuild's language is kept once. That takes two language changes through the launcher with nothing else in between. LongshotLauncher#364 then writes the wizard's language over it after the build. The Risks section says so. **L7:** unchanged, still in Still to test. Checks: `cargo test -p build-driver` passes (160 + 7 + 4), and clippy (`-D warnings`) and `cargo fmt --check` are clean. Only the builder changed in this round, so the game run in my last reply still holds.
Author
Member
@review
BeanBot left a comment

Recommendation: Approve. The migration now avoids treating an older build's default language as a menu choice in the reported case. The recorded first-update and Linux profile runs are still needed. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge.

The game stores the player's language with profile settings so updates can preserve it, and the builder attempts to migrate choices from older installations. The timestamp check reduces false migrations, but can miss a recent choice on filesystems with coarse timestamps.

Should fix (1): not blocking, but worth doing before merging.

  • L10 builder/crates/build-driver/src/folder.rs:658: Equal modification timestamps cause a real menu choice to be discarded. (more on the line) Do: Handle ambiguous equal timestamps without silently discarding the player's choice, and cover that case in the migration tests.

Testing before merging (1) (runs on the systems it can change; it doesn't hold the recommendation)

  • L7: The first update from an older game and the Linux profile path still need their recorded runs. When: The existing Windows run starts with game_language already in settings.ini, so it does not exercise the builder migration or the Linux host path. Do: Run the described old-game update on Windows and the settings override on Linux, recording the resulting language and settings.

@fix can do L10.

Since the last review (on b3cbc4d590)
Resolved: L3 (A different build language is assumed to be a menu choice, although language.txt also hold…)
Still open: L7 (The first update from an older game and the Linux profile path still need their recorded r…)
New: L10 (Equal modification timestamps cause a real menu choice to be discarded.)

Checks: Still running: 7 checks.

More: does it help, other systems, switches, what was read

Does it help: Unproven for the full fix: the reported Windows profile run opened the Chinese text pack, and the author reports passing builder tests, but the real first-update and Linux runs remain outstanding.

Other systems: The builder migration runs on Windows and Linux and depends on filesystem modification times; coarse timestamp resolution can prevent a choice from being recognized. The reported Windows game run covers profile loading, while the Linux profile path remains untested in a recorded game run.

Switches: None added, changed or removed.

Reviewed: 9f1b01617d against 01d6878b3f: Read AGENTS.md and CONTRIBUTING.md, the changes since the prior head, and the builder migration diff and its callers. The remaining changed code and project standards were not read in full; the recorded runs and comments were skimmed.; nothing run (a code review).

Checked and fine:

  • The migration reads the older folder's language before installation can move a flat layout.
  • A folder whose record contains the game_language feature is excluded from migration.
  • The new builder tests cover both an older build's default and a later menu choice.

Testing: No commands that build or run tests were executed. The author reports passing builder tests, clippy and formatting checks; CI is still running.

Overlaps and merge order: LongshotLauncher#364 adds the profile language control and update-wizard behavior; its description says it writes the selected language after the build.


Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.

**Recommendation: Approve.** The migration now avoids treating an older build's default language as a menu choice in the reported case. The recorded first-update and Linux profile runs are still needed. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge. The game stores the player's language with profile settings so updates can preserve it, and the builder attempts to migrate choices from older installations. The timestamp check reduces false migrations, but can miss a recent choice on filesystems with coarse timestamps. **Should fix (1)**: not blocking, but worth doing before merging. - **L10** `builder/crates/build-driver/src/folder.rs:658`: Equal modification timestamps cause a real menu choice to be discarded. (more on the line) **Do:** Handle ambiguous equal timestamps without silently discarding the player's choice, and cover that case in the migration tests. **Testing before merging (1)** (runs on the systems it can change; it doesn't hold the recommendation) - **L7**: The first update from an older game and the Linux profile path still need their recorded runs. *When:* The existing Windows run starts with game_language already in settings.ini, so it does not exercise the builder migration or the Linux host path. **Do:** Run the described old-game update on Windows and the settings override on Linux, recording the resulting language and settings. `@fix` can do L10. **Since the last review** (on b3cbc4d59086) Resolved: L3 (A different build language is assumed to be a menu choice, although language.txt also hold…) Still open: L7 (The first update from an older game and the Linux profile path still need their recorded r…) New: L10 (Equal modification timestamps cause a real menu choice to be discarded.) **Checks:** Still running: 7 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven for the full fix: the reported Windows profile run opened the Chinese text pack, and the author reports passing builder tests, but the real first-update and Linux runs remain outstanding. **Other systems:** The builder migration runs on Windows and Linux and depends on filesystem modification times; coarse timestamp resolution can prevent a choice from being recognized. The reported Windows game run covers profile loading, while the Linux profile path remains untested in a recorded game run. **Switches:** None added, changed or removed. **Reviewed:** 9f1b01617dc0 against 01d6878b3f14: Read AGENTS.md and CONTRIBUTING.md, the changes since the prior head, and the builder migration diff and its callers. The remaining changed code and project standards were not read in full; the recorded runs and comments were skimmed.; nothing run (a code review). **Checked and fine:** - The migration reads the older folder's language before installation can move a flat layout. - A folder whose record contains the game_language feature is excluded from migration. - The new builder tests cover both an older build's default and a later menu choice. **Testing:** No commands that build or run tests were executed. The author reports passing builder tests, clippy and formatting checks; CI is still running. **Overlaps and merge order:** LongshotLauncher#364 adds the profile language control and update-wizard behavior; its description says it writes the selected language after the build. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.</sub>
@ -637,0 +655,4 @@
let written = |p: &Path| std::fs::metadata(p).and_then(|m| m.modified()).ok();
let record = RECORD_FILES.iter().find_map(|n| written(&out.join(n)))?;
let txt = written(&build_core::game_layout::config(out).join("language.txt"))?;
if txt <= record {
Member

L10 (should fix): Equal modification timestamps cause a real menu choice to be discarded.

When: On a filesystem with two-second timestamp resolution, a player can change the language shortly after a build writes its record. If both timestamps fall in the same interval, the comparison returns None and the next update overwrites the chosen language.

Do: Handle ambiguous equal timestamps without silently discarding the player's choice, and cover that case in the migration tests.

**L10** (should fix): Equal modification timestamps cause a real menu choice to be discarded. *When:* On a filesystem with two-second timestamp resolution, a player can change the language shortly after a build writes its record. If both timestamps fall in the same interval, the comparison returns None and the next update overwrites the chosen language. **Do:** Handle ambiguous equal timestamps without silently discarding the player's choice, and cover that case in the migration tests.
test(builder): a language.txt and a record at the same time are the build's
Some checks failed
PR description / Title and description (pull_request_target) Successful in 7s
CI / What the change needs (pull_request) Successful in 10s
CI / Third-party parts and guide screenshots (pull_request) Successful in 15s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Successful in 19s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Failing after 4m8s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 2m19s
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Successful in 4m15s
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Successful in 4m24s
CI / Website build and checks (pull_request) Failing after 1m21s
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Failing after 14m17s
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Failing after 31m56s
c1703bb238
BeanBot's third review (L10) asked that equal times not drop a menu choice. They stay the build's: a
build writes language.txt and its record milliseconds apart, the same tick on a coarse clock (FAT's
is two seconds), so taking equal times for a choice would make every build's own language one there,
while a menu choice comes after the game has started and the row was left. The check now says why,
and the unit test pins the case.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Member

Thanks. On L10 (equal times dropping a menu choice) I've kept the behaviour, on purpose, and pinned it in c1703bb23.

A build writes language.txt and then its record milliseconds apart. On a coarse clock (FAT's is two seconds) the two writes usually land on the same tick. If equal times counted as a menu choice, every build's own language on such a drive would be taken for one, which is L3 again for every player there. A real menu choice can't land on that tick: the game has to start after the build, and the Game language row saves only once the player leaves it, so that's well over two seconds later. On NTFS and ext4 the times are fine-grained, so the question doesn't come up. The check now says this in a comment, and an_update_keeps_the_language_chosen_in_the_game sets both files to the same time and expects the build's language.

L7: unchanged, still in Still to test.

Checks: the builder unit tests pass, and clippy (-D warnings) and cargo fmt --check are clean. Only a test and a comment changed.

Thanks. On **L10** (equal times dropping a menu choice) I've kept the behaviour, on purpose, and pinned it in `c1703bb23`. A build writes `language.txt` and then its record milliseconds apart. On a coarse clock (FAT's is two seconds) the two writes usually land on the same tick. If equal times counted as a menu choice, every build's own language on such a drive would be taken for one, which is L3 again for every player there. A real menu choice can't land on that tick: the game has to start after the build, and the Game language row saves only once the player leaves it, so that's well over two seconds later. On NTFS and ext4 the times are fine-grained, so the question doesn't come up. The check now says this in a comment, and `an_update_keeps_the_language_chosen_in_the_game` sets both files to the same time and expects the build's language. **L7:** unchanged, still in Still to test. Checks: the builder unit tests pass, and clippy (`-D warnings`) and `cargo fmt --check` are clean. Only a test and a comment changed.
futondestroyer left a comment

Request changes. The host and menu now share the profile language precedence, and the Windows startup run confirms the game opened the Chinese text pack with English in the build file. Three issues remain on this head.

  • A genuine legacy menu choice is skipped when it matches the first new build's requested language. That build writes the feature marker, so the next build can change the language before the choice ever reaches the profile. Preserve the original choice on the first migration regardless of the requested build language.
  • Startup treats an existing profile's read failure as a profile with no settings. With legacy install settings available, it can replace the unreadable profile. Preserve the existing file unless it was read successfully and confirmed eligible for the copy.
  • Players who never chose a profile language now have language.txt opened, parsed, and closed each displayed frame, even with the menu closed. Cache the build-language fallback as before and retain the read-back after an actual save.

The Windows headless run at b3cbc4d59 exercised profile precedence and the options copy, and the game and host sources are unchanged since that run. The Windows update through Launcher with a pre-feature game's menu choice and Linux game startup still need results. Please exercise the two-update migration case where the first build requests the same language. Current head c1703bb238549194a832705f9d596e1d28c6475e against 01d6878b3f148e68d7a9080133d193e1fb7c2973. Exact-head host and both renderer builds passed. The two Builder language tests and all three changed Python fixtures passed. Website branding, Rust formatting and the synthetic game layout fail on other PRs with the same base. The game-free runs have 31 matching failing fixtures and one additional unresolved test_longshot_ctl.py relaunch timeout with subsequent failures. Windows test · CI · Launcher follow-up

**Request changes.** The host and menu now share the profile language precedence, and the Windows startup run confirms the game opened the Chinese text pack with English in the build file. Three issues remain on this head. - A genuine legacy menu choice is skipped when it matches the first new build's requested language. That build writes the feature marker, so the next build can change the language before the choice ever reaches the profile. Preserve the original choice on the first migration regardless of the requested build language. - Startup treats an existing profile's read failure as a profile with no settings. With legacy install settings available, it can replace the unreadable profile. Preserve the existing file unless it was read successfully and confirmed eligible for the copy. - Players who never chose a profile language now have `language.txt` opened, parsed, and closed each displayed frame, even with the menu closed. Cache the build-language fallback as before and retain the read-back after an actual save. The Windows headless run at `b3cbc4d59` exercised profile precedence and the options copy, and the game and host sources are unchanged since that run. The Windows update through Launcher with a pre-feature game's menu choice and Linux game startup still need results. Please exercise the two-update migration case where the first build requests the same language. Current head `c1703bb238549194a832705f9d596e1d28c6475e` against `01d6878b3f148e68d7a9080133d193e1fb7c2973`. Exact-head host and both renderer builds passed. The two Builder language tests and all three changed Python fixtures passed. Website branding, Rust formatting and the synthetic game layout fail on other PRs with the same base. The game-free runs have 31 matching failing fixtures and one additional unresolved `test_longshot_ctl.py` relaunch timeout with subsequent failures. [Windows test](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2794#issuecomment-89639) · [CI](https://git.magicbean.dev/MagicBeanDev/Longshot/actions/runs/57397) · [Launcher follow-up](https://git.magicbean.dev/MagicBeanDev/LongshotLauncher/pulls/364)
@ -637,0 +673,4 @@
/// gets one with that line alone: the game still copies a game folder's settings into it once (host/options_path.c). Whether
/// it was put there.
pub fn keep_chosen_language(old: Option<&str>, profile: &Path, language: &str) -> Result<bool> {
let Some(chosen) = old.filter(|chosen| *chosen != language) else {
Member

[P2] Persist an identified legacy menu choice even when it equals the requested language. If a player chose zh-Hans in the old game's menu and the first upgrade also asks for zh-Hans, this returns without writing settings.ini. The new build records the feature, so a second upgrade asking for en-US overwrites the only remaining choice. Please add that two-upgrade case.

[P2] Persist an identified legacy menu choice even when it equals the requested language. If a player chose zh-Hans in the old game's menu and the first upgrade also asks for zh-Hans, this returns without writing settings.ini. The new build records the feature, so a second upgrade asking for en-US overwrites the only remaining choice. Please add that two-upgrade case.
@ -211,0 +227,4 @@
/// The game's language at its next start, the Game language row's: the choice, else language.txt's, else the one it runs in
std::string game_language_next() {
if (!game_language_chosen().empty()) return game_language_chosen();
const std::string txt = read_language_txt();
Member

[P2] Cache the build-language fallback. menu_tick runs each displayed frame, and game_lang_tick calls game_lang_index before checking whether the menu is open. With no game_language choice, this now opens, parses, and closes language.txt inside the menu lock on every frame. Main cached the fallback in game_language_saved(). Keep the explicit file read after changing and saving the setting.

[P2] Cache the build-language fallback. menu_tick runs each displayed frame, and game_lang_tick calls game_lang_index before checking whether the menu is open. With no game_language choice, this now opens, parses, and closes language.txt inside the menu lock on every frame. Main cached the fallback in game_language_saved(). Keep the explicit file read after changing and saving the setting.
@ -107,0 +154,4 @@
/* (a profile's file with only the launcher's game_language= is not the player's settings yet: the copy comes, and the line
is kept in it) */
const int there = GetFileAttributesA(file) != INVALID_FILE_ATTRIBUTES;
if (there && has_settings(file)) return;
Member

[P2] Preserve an existing profile if reading it fails. has_settings() returns false on fopen failure or a partial read without a recognized key, and language_line() ignores the same failures. With legacy install settings available, this path can atomically replace an unreadable profile on Linux if its parent directory allows rename. Please distinguish an eligible profile from a read error and exercise a destination read failure. The existing read-error fixture injects a failure in the source file.

[P2] Preserve an existing profile if reading it fails. has_settings() returns false on fopen failure or a partial read without a recognized key, and language_line() ignores the same failures. With legacy install settings available, this path can atomically replace an unreadable profile on Linux if its parent directory allows rename. Please distinguish an eligible profile from a read error and exercise a destination read failure. The existing read-error fixture injects a failure in the source file.
llun force-pushed fix/game-language-in-options from c1703bb238
Some checks failed
PR description / Title and description (pull_request_target) Successful in 7s
CI / What the change needs (pull_request) Successful in 10s
CI / Third-party parts and guide screenshots (pull_request) Successful in 15s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Successful in 19s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Failing after 4m8s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 2m19s
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Successful in 4m15s
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Successful in 4m24s
CI / Website build and checks (pull_request) Failing after 1m21s
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Failing after 14m17s
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Failing after 31m56s
to a865939d98
Some checks failed
PR description / Title and description (pull_request_target) Successful in 10s
CI / Third-party parts and guide screenshots (pull_request) Failing after 16s
CI / What the change needs (pull_request) Successful in 16s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Successful in 20s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
2026-11-29 17:03:35 +00:00
Compare
futondestroyer's review of the pull request. These fail on its head:
- builder (driver.rs, folder.rs): the first update to a game with game_language= asks for the language
  the older game's menu chose; the choice is still written into the profile, so the second update,
  asking for English, leaves the game in the chosen language.
- host/options_path.c: a profile settings.ini that cannot be read (a folder in its place) is left
  alone: no copy of the game folder's settings is tried over it.
- gpu/vk/vk_menu_i18n.cpp: with no choice made, the Game language row's language.txt fallback is read
  once, not at each frame's game_lang_tick.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
futondestroyer's review of the pull request:
- builder (folder.rs keep_chosen_language, build.rs): a choice the older game's menu made is put in
  the profile whatever language the first update asks for, the same one too. That update's folder
  gets the game_language feature, so it is the one time the choice can be kept, and the next update
  may ask for another language.
- host/options_path.c: has_settings says when a file could not be read (not opened, or a read failed
  before a setting was found), and language_line whether it read the file whole. A profile
  settings.ini that cannot be read is left as it is and logged, never taken for one with no settings
  and copied over.
- gpu/vk/vk_menu_i18n.cpp: with no choice made, the Game language row's fallback (language.txt's, else
  the language the game runs in) is read once (game_language_built), as main did, not at each frame's
  game_lang_tick. The settings are still read back after a save (game_language_saved).
- docs/dev/reference/build.md: the migration's rule.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
docs(guide): settings-graphics.png kept after the language change, its review recorded
Some checks failed
CI / What the change needs (pull_request) Successful in 12s
CI / Third-party parts and guide screenshots (pull_request) Successful in 19s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Successful in 21s
PR description / Title and description (pull_request_target) Successful in 9s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
c8b4ec3054
scripts/check_guide_screenshots.py --review-sources flags settings-graphics.png: this pull request's
menu files changed, and on main since its last review, #1585 (the 45 FPS cap) and #152 (the Keyboard
row) changed five more of its UI sources (main flags those too). Rendered with the UI-only helper
from main f14a5664 and from b7f2825c, the Graphics, Audio and Controls pages differ only in the
version text's box, and the published image differs from b7f2825c's render in that box alone: the
hashes and a note are recorded, the PNG is unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Member

Thanks for the review, all three points held. The branch is rebased onto main f14a5664d. eb93ced08 adds the tests, which fail on the reviewed head c1703bb23 (as 9f1b01617 before the rebase) for the reasons you gave. b7f2825c0 is the fix, and c8b4ec305 re-records the guide picture's review after the rebase. Head: c8b4ec305.

  • A menu choice skipped when the first update asks for the same language (folder.rs): fixed. keep_chosen_language no longer compares with the build's language. A choice identified in an older game's menu goes into the profile whatever the update asks for, the same language too, since that update gives the folder the feature. The new driver test a_menu_choice_is_kept_when_the_first_update_asks_for_the_same_language is your two-update case. The menu chose zh-Hans and the first update asks for zh-Hans: the profile gets game_language=zh-Hans. The second update asks for en-US: language.txt says en-US and the profile still says zh-Hans. On the old head the profile got nothing. The builder's log line now names the kept language.
  • An unreadable profile taken for one with no settings (options_path.c): fixed. has_settings now returns -1 when the file can't be opened or a read fails before a setting is found, and language_line says whether it read the file whole. Either failure leaves the profile's file as it is, logs options: <file> could not be read: left as it is, the game folder's settings not put over it, and copies nothing. The test injects the failure into the destination, with a folder in the place of settings.ini. On the old head the copy was tried over it. In the game, with such a profile, the log said exactly that, the game started in language.txt's English, and the folder was untouched.
  • language.txt read at each frame (vk_menu_i18n.cpp): fixed. The row's fallback with no choice (language.txt's, else the language the game runs in) is read once (game_language_built), as main's game_language_saved() was. The read-back after an actual save (game_language_saved) stays. The test changes language.txt after the start and expects the row to stay on the first read; on the old head it followed the file.

Tested again in the game (Windows 11, RTX 5080, NVIDIA 621.40, c8b4ec305 as a pack over the shared base, through the job queue, headless). The profile with only game_language=zh-Hans, over an en-US language.txt, gave oe: language zh-Hans (game_language in the settings) and opened Mals/CNzh. The game folder's settings were copied in once with the one line kept, and the run stopped with stop: close work done. The unreadable-profile run is described above.

Checks:

  • cargo test -p build-driver passes (160 + 8 + 4), and cargo fmt --check and cargo clippy -p build-driver --all-targets --no-deps -D warnings are clean. Without --no-deps, clippy now stops on main's build-compile, from #2782.
  • Of the 144 checks run_all.py --changed picks, on WSL Ubuntu 24.04: 117 passed, 19 were skipped for missing tools, and 8 failed. All 8 fail the same way on main: the 7 named in the description, and test_keyboard_option, new on main with #152.
  • The guide check passes again: rendered from main and from b7f2825c, the pages differ only in the version text's box.
  • I haven't looked into the test_longshot_ctl.py relaunch timeout you saw. This PR doesn't touch that code or longshot_ctl.

Still to test is unchanged: the Windows update through the launcher from a game with a menu choice from before this change, now with your two-update case added, and the Linux start-up.

Thanks for the review, all three points held. The branch is rebased onto main `f14a5664d`. `eb93ced08` adds the tests, which fail on the reviewed head `c1703bb23` (as `9f1b01617` before the rebase) for the reasons you gave. `b7f2825c0` is the fix, and `c8b4ec305` re-records the guide picture's review after the rebase. Head: `c8b4ec305`. - **A menu choice skipped when the first update asks for the same language** (`folder.rs`): fixed. `keep_chosen_language` no longer compares with the build's language. A choice identified in an older game's menu goes into the profile whatever the update asks for, the same language too, since that update gives the folder the feature. The new driver test `a_menu_choice_is_kept_when_the_first_update_asks_for_the_same_language` is your two-update case. The menu chose zh-Hans and the first update asks for zh-Hans: the profile gets `game_language=zh-Hans`. The second update asks for en-US: `language.txt` says en-US and the profile still says zh-Hans. On the old head the profile got nothing. The builder's log line now names the kept language. - **An unreadable profile taken for one with no settings** (`options_path.c`): fixed. `has_settings` now returns -1 when the file can't be opened or a read fails before a setting is found, and `language_line` says whether it read the file whole. Either failure leaves the profile's file as it is, logs `options: <file> could not be read: left as it is, the game folder's settings not put over it`, and copies nothing. The test injects the failure into the destination, with a folder in the place of `settings.ini`. On the old head the copy was tried over it. In the game, with such a profile, the log said exactly that, the game started in `language.txt`'s English, and the folder was untouched. - **`language.txt` read at each frame** (`vk_menu_i18n.cpp`): fixed. The row's fallback with no choice (`language.txt`'s, else the language the game runs in) is read once (`game_language_built`), as main's `game_language_saved()` was. The read-back after an actual save (`game_language_saved`) stays. The test changes `language.txt` after the start and expects the row to stay on the first read; on the old head it followed the file. **Tested again in the game** (Windows 11, RTX 5080, NVIDIA 621.40, `c8b4ec305` as a pack over the shared base, through the job queue, headless). The profile with only `game_language=zh-Hans`, over an en-US `language.txt`, gave `oe: language zh-Hans (game_language in the settings)` and opened `Mals/CNzh`. The game folder's settings were copied in once with the one line kept, and the run stopped with `stop: close work done`. The unreadable-profile run is described above. **Checks:** - `cargo test -p build-driver` passes (160 + 8 + 4), and `cargo fmt --check` and `cargo clippy -p build-driver --all-targets --no-deps -D warnings` are clean. Without `--no-deps`, clippy now stops on main's `build-compile`, from #2782. - Of the 144 checks `run_all.py --changed` picks, on WSL Ubuntu 24.04: 117 passed, 19 were skipped for missing tools, and 8 failed. All 8 fail the same way on main: the 7 named in the description, and `test_keyboard_option`, new on main with #152. - The guide check passes again: rendered from main and from `b7f2825c`, the pages differ only in the version text's box. - I haven't looked into the `test_longshot_ctl.py` relaunch timeout you saw. This PR doesn't touch that code or `longshot_ctl`. **Still to test** is unchanged: the Windows update through the launcher from a game with a menu choice from before this change, now with your two-update case added, and the Linux start-up.
llun force-pushed fix/game-language-in-options from c8b4ec3054
Some checks failed
CI / What the change needs (pull_request) Successful in 12s
CI / Third-party parts and guide screenshots (pull_request) Successful in 19s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Successful in 21s
PR description / Title and description (pull_request_target) Successful in 9s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
to 9ef12bc710
Some checks failed
CI / What the change needs (pull_request) Successful in 11s
CI / Third-party parts and guide screenshots (pull_request) Successful in 16s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Successful in 16s
PR description / Title and description (pull_request_target) Successful in 7s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
2026-11-29 17:32:32 +00:00
Compare
Author
Member

Rebased onto main b6d274d77 (head 9ef12bc71). No conflicts, and this PR's commits are unchanged. The three points from @futondestroyer's review are answered in my comment above, with the fixes in b7f2825c0 (now 3951bb9df after the rebase).

The whole suite, mise run test on Windows with MSYS2's tools on PATH, at 283a779de on main 01539efd2: 807 passed, 48 failed, 47 skipped.

  • 46 of the 48 fail the same way on main 01539efd2 on this PC.
  • The other 2, test_dev_ab and test_present_semaphores, read none of this PR's files. They pass on main, and they pass here when run alone; they failed under the full run's load.
  • This PR's own checks (test_game_language, test_options_path, test_settings_atomic, test_menu_env_overrides) pass on Windows at 9ef12bc71.

The two commits main gained since (#2790, #2803) touch only the Linux profiler and the Linux display, so the game run on c8b4ec305 still holds. In it, a zh-Hans profile over an en-US build started in Chinese, and an unreadable profile file was left alone.

Rebased onto main `b6d274d77` (head `9ef12bc71`). No conflicts, and this PR's commits are unchanged. The three points from @futondestroyer's review are answered in my comment above, with the fixes in `b7f2825c0` (now `3951bb9df` after the rebase). The whole suite, `mise run test` on Windows with MSYS2's tools on PATH, at `283a779de` on main `01539efd2`: 807 passed, 48 failed, 47 skipped. - 46 of the 48 fail the same way on main `01539efd2` on this PC. - The other 2, `test_dev_ab` and `test_present_semaphores`, read none of this PR's files. They pass on main, and they pass here when run alone; they failed under the full run's load. - This PR's own checks (`test_game_language`, `test_options_path`, `test_settings_atomic`, `test_menu_env_overrides`) pass on Windows at `9ef12bc71`. The two commits main gained since (#2790, #2803) touch only the Linux profiler and the Linux display, so the game run on `c8b4ec305` still holds. In it, a zh-Hans profile over an en-US build started in Chinese, and an unreadable profile file was left alone.
The maintainer's call: the new launcher plays only builds of a builder that has game_language=, so
language.txt goes now rather than after the next stable release. These fail on the head:
- tests/test_game_language.py: the game writes no language.txt at its start (no template), and a
  leftover one (a folder built before) is moved into the settings once (host/options_path.c
  hos_language_move): its language added as game_language= when they have none, the file removed,
  a settings file made with that line when there is none, a choice in the settings kept over it.
- builder (driver.rs): a build writes no language.txt; its language seeds the profile's settings
  only when the profile has no choice, and without a profile the game folder's own settings file;
  an update removes a leftover language.txt once its choice is carried.
- play.rs: the language is no longer part of the profile's build key (a change needs no build).
- verify.rs: a leftover language.txt is no longer the player's data: said as an extra.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The maintainer's call: the new launcher plays only builds of a builder that has game_language=, so
language.txt goes now, as part of this pull request.
- host/options_path.c hos_language_move (hos_main.c, after the settings carry, before the game or the
  menu reads the language): a language.txt a build from before left is moved into the settings once,
  its language added as game_language= when they have none (a file made with the line when there is
  none), then the file removed; a leftover under a choice is removed too. The settings are written
  first, whole, so a kill before the removal leaves the line, and the next start removes the leftover.
  With no settings file this run, or one that cannot be written, the leftover stays and is read.
- host/nn_applet.c desired_language: no first-start language.txt template; HOS_LANGUAGE, the settings,
  such a leftover, else English (US).
- builder (build.rs, folder.rs put_language, settings_path, remove_language_txt): no language.txt is
  written. The language an older game's menu chose (menu_language), else the build's, goes into the
  profile's settings.ini, or without a profile the settings the game then reads (config/settings.ini,
  a flat folder's longshot_options.ini; not config/build.ini, which holds only Compile shaders), only
  when they hold no game_language=. A leftover language.txt is removed.
- play.rs: the language is out of the profile's build key: a change needs no rebuild.
- verify.rs: language.txt is no longer the player's data (a leftover is said as an extra).
- Comments in the menu, switches.def's HOS_LANGUAGE, game_layout.c and features.txt; and
  tests/test_settings_atomic.py, which reads desired_language and the new move.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The maintainer's call (no build writes language.txt now): the player docs (Game language's default,
what an update keeps, the wrong-language entry: a leftover language.txt moved at the first start),
the build reference (--language now puts the language in the settings when they hold none, not in a
language.txt; not part of the build key; verify's excluded files), builder.md (the finish, the game
folder's files), profiles.md (profile.json's language, the game's language row), releases.md (the
files a build writes), and CONTRIBUTING's and assets/saves' banned files (language.txt kept there as
an old file).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
docs(guide): settings-graphics.png kept after the language.txt removal, its review recorded
Some checks failed
CI / What the change needs (pull_request) Successful in 13s
CI / Third-party parts and guide screenshots (pull_request) Successful in 15s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Successful in 18s
PR description / Title and description (pull_request_target) Successful in 7s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
6b5b4151bd
The menu files' comments changed again (the language only in the settings). Rendered with the UI-only
helper from main b6d274d7 and from this head, the Graphics, Audio and Controls pages differ only in
the version text's box, and the published image differs from this head's render in that box alone:
the hashes and a note are recorded, the PNG is unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Member

language.txt is gone in this PR now. This is the maintainer's call: the new launcher plays only builds of a builder that has game_language=, so the migration happens now instead of after the next stable release. The tests are in 625a6849a and fail on the previous head. The fix is in 477943544, the docs in 878c90470, and the guide picture's review in 6b5b4151b.

What changed:

  • Game: no build writes language.txt, and the game no longer makes one at its first start. A language.txt that a build from before left in the game folder is moved into the settings once at the start (host/options_path.c hos_language_move, run right after the settings carry and before the game or the Insert menu reads the language). Its language is added as game_language= when the settings hold none, then the file is removed. The settings are written first, whole, so a kill before the removal loses nothing. Without a settings file, or with one that can't be written, the leftover stays and is read for that run.
  • Builder: a build puts its language into the settings only when they hold no game_language= yet, and never writes over a choice. That's the profile's settings.ini, or without --profile the file the game then reads.
    • The language is the one an older game's menu chose (the same evidence rule as before), else the build's: --language, the profile's language, else the system's.
    • A leftover language.txt is removed. The language is no longer part of the build key, so changing it needs no rebuild.
    • verify no longer counts language.txt as the player's data; a leftover is reported as an extra and left alone.
  • Where the design was changed, and why: for a build without a profile, the language goes into config/settings.ini (a flat folder's longshot_options.ini), not folder::options_path. In an organized folder that's config/build.ini, which holds only the builder's Compile shaders choice, and the game doesn't read its settings from it (host/options_path.c).

Tested in the game (Windows 11, RTX 5080, NVIDIA 621.40; the branch as a pack over the shared base, through the job queue, headless):

  • A profile with no settings, over a game folder holding a leftover zh-Hans language.txt: options: ...config/language.txt's language zh-Hans moved into ...settings.ini (game_language=), then oe: language zh-Hans (game_language in the settings). The Chinese text pack (Mals/CNzh) opened, the leftover was gone afterwards, the profile kept game_language=zh-Hans, and the run stopped cleanly.
  • A profile with game_language=ja: oe: language ja (game_language in the settings), the Japanese text pack (Mals/JPja), and a clean stop.

Checks:

  • test_game_language passes with gcc and clang. test_settings_atomic now also checks that desired_language writes no file and that the move writes whole.
  • cargo test -p build-driver passes (160 + 9 + 4); clippy (--no-deps -D warnings) and cargo fmt --check are clean.
  • longshot-builder and build-compile have failures, but exactly the same ones fail on main b6d274d77 on this PC (6 in longshot-builder, 2 build-compile toolchain tests).
  • The guide check passes again: the pages render the same as on main but for the version text.

mise run test (Windows, MSYS2's tools on PATH): 811 passed, 45 failed, 47 skipped. All 45 fail the same way on main here (the description lists the run they're compared with).

`language.txt` is gone in this PR now. This is the maintainer's call: the new launcher plays only builds of a builder that has `game_language=`, so the migration happens now instead of after the next stable release. The tests are in `625a6849a` and fail on the previous head. The fix is in `477943544`, the docs in `878c90470`, and the guide picture's review in `6b5b4151b`. **What changed:** - **Game:** no build writes `language.txt`, and the game no longer makes one at its first start. A `language.txt` that a build from before left in the game folder is moved into the settings once at the start (`host/options_path.c` `hos_language_move`, run right after the settings carry and before the game or the Insert menu reads the language). Its language is added as `game_language=` when the settings hold none, then the file is removed. The settings are written first, whole, so a kill before the removal loses nothing. Without a settings file, or with one that can't be written, the leftover stays and is read for that run. - **Builder:** a build puts its language into the settings only when they hold no `game_language=` yet, and never writes over a choice. That's the profile's `settings.ini`, or without `--profile` the file the game then reads. - The language is the one an older game's menu chose (the same evidence rule as before), else the build's: `--language`, the profile's `language`, else the system's. - A leftover `language.txt` is removed. The language is no longer part of the build key, so changing it needs no rebuild. - `verify` no longer counts `language.txt` as the player's data; a leftover is reported as an extra and left alone. - **Where the design was changed, and why:** for a build without a profile, the language goes into `config/settings.ini` (a flat folder's `longshot_options.ini`), not `folder::options_path`. In an organized folder that's `config/build.ini`, which holds only the builder's Compile shaders choice, and the game doesn't read its settings from it (`host/options_path.c`). **Tested in the game** (Windows 11, RTX 5080, NVIDIA 621.40; the branch as a pack over the shared base, through the job queue, headless): - A profile with no settings, over a game folder holding a leftover zh-Hans `language.txt`: `options: ...config/language.txt's language zh-Hans moved into ...settings.ini (game_language=)`, then `oe: language zh-Hans (game_language in the settings)`. The Chinese text pack (`Mals/CNzh`) opened, the leftover was gone afterwards, the profile kept `game_language=zh-Hans`, and the run stopped cleanly. - A profile with `game_language=ja`: `oe: language ja (game_language in the settings)`, the Japanese text pack (`Mals/JPja`), and a clean stop. **Checks:** - `test_game_language` passes with gcc and clang. `test_settings_atomic` now also checks that `desired_language` writes no file and that the move writes whole. - `cargo test -p build-driver` passes (160 + 9 + 4); clippy (`--no-deps -D warnings`) and `cargo fmt --check` are clean. - `longshot-builder` and `build-compile` have failures, but exactly the same ones fail on main `b6d274d77` on this PC (6 in `longshot-builder`, 2 `build-compile` toolchain tests). - The guide check passes again: the pages render the same as on main but for the version text. `mise run test` (Windows, MSYS2's tools on PATH): 811 passed, 45 failed, 47 skipped. All 45 fail the same way on main here (the description lists the run they're compared with).
Author
Member
@review
BeanBot left a comment

Recommendation: Request changes. A build can delete the only copy of a player's legacy language choice when it cannot read the profile settings. Equal timestamps also still discard a genuine menu choice.

The change moves the game language into profile settings so updates can preserve it, and removes new writes of language.txt. It simplifies the long-term storage model, but migration can lose a choice in the cases identified.

Blocking (1): must change before merging.

  1. L11 builder/crates/build-driver/src/build.rs:765: The builder removes the legacy language file even when it could not read the profile settings and therefore did not preserve its language. (more on the line) Do: Distinguish an existing choice from a settings read failure, and retain language.txt or fail the build when the choice could not be safely preserved.

Should fix (1): not blocking, but worth doing before merging.

  • L10 builder/crates/build-driver/src/folder.rs:658: Equal modification timestamps cause a real menu choice to be discarded. When: On a filesystem with two-second timestamp resolution, a player can change the language shortly after a build writes its record. If both timestamps fall in the same interval, the comparison returns None and the next update overwrites the chosen language. Do: Handle ambiguous equal timestamps without silently discarding the player's choice, and cover that case in the migration tests.

Testing before merging (1) (runs on the systems it can change; it doesn't hold the recommendation)

  • L7: The first update from an older game and the Linux profile path still need their recorded runs. When: The existing Windows run starts with game_language already in settings.ini, so it does not exercise the builder migration or the Linux host path. Do: Run the described old-game update on Windows and the settings override on Linux, recording the resulting language and settings.

@fix can do L10 and L11.

Since the last review (on 9f1b01617d)
Still open: L7 (The first update from an older game and the Linux profile path still need their recorded r…); L10 (Equal modification timestamps cause a real menu choice to be discarded.)
New: L11 (The builder removes the legacy language file even when it could not read the profile setti…)

Checks: Still running: 7 checks.

More: does it help, other systems, switches, what was read

Does it help: Unproven for the complete update path: the recorded Windows game runs show settings precedence and startup migration working, but the real first update from an older game and the Linux profile run remain outstanding.

Other systems: The builder, game startup, Insert menu and launcher share the setting. Windows startup has recorded game runs; Linux startup and the real launcher update path still need runs. Older builds read only language.txt and therefore fall back to English after its removal, as disclosed in the description.

Switches: No switch added, changed or removed. HOS_LANGUAGE remains a one-run override.

Reviewed: 6b5b4151bd against b6d274d779: Read the ledger, supplied comments, reviews and test reports; inspected the repository rules, pull request template, commit list, and diffs for the builder, host and menu language paths. The complete changed files, remaining documentation, tests, translations and generated manifest were not read in full.; nothing run (a code review).

Checked and fine:

  • A legacy choice identified by a newer timestamp is passed to the settings writer even when it equals the requested build language.
  • The recorded Windows startup runs show Chinese and Japanese settings selecting their respective text packs.

Testing: No commands that build or run project code were executed. The supplied reports record passing targeted tests and Windows game runs; CI is still running.

Overlaps and merge order: LongshotLauncher#364 provides the launcher-side profile language setting and update-wizard behavior.


Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.

**Recommendation: Request changes.** A build can delete the only copy of a player's legacy language choice when it cannot read the profile settings. Equal timestamps also still discard a genuine menu choice. The change moves the game language into profile settings so updates can preserve it, and removes new writes of language.txt. It simplifies the long-term storage model, but migration can lose a choice in the cases identified. **Blocking (1)**: must change before merging. 1. **L11** `builder/crates/build-driver/src/build.rs:765`: The builder removes the legacy language file even when it could not read the profile settings and therefore did not preserve its language. (more on the line) **Do:** Distinguish an existing choice from a settings read failure, and retain language.txt or fail the build when the choice could not be safely preserved. **Should fix (1)**: not blocking, but worth doing before merging. - **L10** `builder/crates/build-driver/src/folder.rs:658`: Equal modification timestamps cause a real menu choice to be discarded. *When:* On a filesystem with two-second timestamp resolution, a player can change the language shortly after a build writes its record. If both timestamps fall in the same interval, the comparison returns None and the next update overwrites the chosen language. **Do:** Handle ambiguous equal timestamps without silently discarding the player's choice, and cover that case in the migration tests. **Testing before merging (1)** (runs on the systems it can change; it doesn't hold the recommendation) - **L7**: The first update from an older game and the Linux profile path still need their recorded runs. *When:* The existing Windows run starts with game_language already in settings.ini, so it does not exercise the builder migration or the Linux host path. **Do:** Run the described old-game update on Windows and the settings override on Linux, recording the resulting language and settings. `@fix` can do L10 and L11. **Since the last review** (on 9f1b01617dc0) Still open: L7 (The first update from an older game and the Linux profile path still need their recorded r…); L10 (Equal modification timestamps cause a real menu choice to be discarded.) New: L11 (The builder removes the legacy language file even when it could not read the profile setti…) **Checks:** Still running: 7 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven for the complete update path: the recorded Windows game runs show settings precedence and startup migration working, but the real first update from an older game and the Linux profile run remain outstanding. **Other systems:** The builder, game startup, Insert menu and launcher share the setting. Windows startup has recorded game runs; Linux startup and the real launcher update path still need runs. Older builds read only language.txt and therefore fall back to English after its removal, as disclosed in the description. **Switches:** No switch added, changed or removed. HOS_LANGUAGE remains a one-run override. **Reviewed:** 6b5b4151bdba against b6d274d779da: Read the ledger, supplied comments, reviews and test reports; inspected the repository rules, pull request template, commit list, and diffs for the builder, host and menu language paths. The complete changed files, remaining documentation, tests, translations and generated manifest were not read in full.; nothing run (a code review). **Checked and fine:** - A legacy choice identified by a newer timestamp is passed to the settings writer even when it equals the requested build language. - The recorded Windows startup runs show Chinese and Japanese settings selecting their respective text packs. **Testing:** No commands that build or run project code were executed. The supplied reports record passing targeted tests and Windows game runs; CI is still running. **Overlaps and merge order:** LongshotLauncher#364 provides the launcher-side profile language setting and update-wizard behavior. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.</sub>
@ -736,0 +762,4 @@
folder::GAME_LANGUAGE_KEY
));
}
let gone = folder::remove_language_txt(&p.out)?;
Member

L11 (blocking): The builder removes the legacy language file even when it could not read the profile settings and therefore did not preserve its language.

When: If an older game's language.txt contains a menu choice and the profile settings.ini cannot be read, put_language returns false without writing the choice. The build then removes language.txt, leaving no readable copy for the game to migrate on a later start.

Do: Distinguish an existing choice from a settings read failure, and retain language.txt or fail the build when the choice could not be safely preserved.

**L11** (blocking): The builder removes the legacy language file even when it could not read the profile settings and therefore did not preserve its language. *When:* If an older game's language.txt contains a menu choice and the profile settings.ini cannot be read, put_language returns false without writing the choice. The build then removes language.txt, leaving no readable copy for the game to migrate on a later start. **Do:** Distinguish an existing choice from a settings read failure, and retain language.txt or fail the build when the choice could not be safely preserved.
fix(builder): a language.txt stays when the settings it would go into cannot be read
Some checks failed
PR description / Title and description (pull_request_target) Successful in 11s
CI / What the change needs (pull_request) Successful in 14s
CI / Third-party parts and guide screenshots (pull_request) Successful in 19s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Successful in 14s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
22d2220eaf
Review of #2794 (L11): when the profile's settings.ini was there but could not be read, put_language put
no language there, and the build then removed the folder's language.txt, the only copy of an older game's
menu choice. put_language now says which of the three it was (put, kept, unreadable), and settle_language
removes a leftover language.txt only when the settings could be read; otherwise it stays, the log says
why, and the game moves it into the settings at its start.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Member

Thanks. L11 is fixed in 22d2220ea. put_language now tells apart the three outcomes (the language put there, a choice already there and kept, or settings that couldn't be read). The new settle_language removes a leftover language.txt only when the settings could be read. When they couldn't, the file stays as the only copy of the older game's choice, the build log says why, and the game moves it into the settings at its start. New test: folder::tests::a_language_txt_stays_when_the_settings_cannot_be_read (unreadable: the file stays; readable: the line is put and the file goes; a choice already there: kept, and the file goes).

L10: unchanged, for the reason in my earlier reply. The build writes language.txt and its record milliseconds apart, so on a coarse clock an equal time is the build's own language. Treating it as a menu choice would bring back L3, where a build's default becomes a permanent preference. A player who chose in the same two-second tick as the build would have to pick it again once. The test pins this.

L7: still to run, as listed under Still to test.

Checks: cargo test -p build-driver language passes; clippy is clean on the two changed files. Clippy's two needless_borrows_for_generic_args errors in build-compile/src/lib.rs come from main; this PR doesn't touch that file.

Thanks. **L11** is fixed in `22d2220ea`. `put_language` now tells apart the three outcomes (the language put there, a choice already there and kept, or settings that couldn't be read). The new `settle_language` removes a leftover `language.txt` only when the settings could be read. When they couldn't, the file stays as the only copy of the older game's choice, the build log says why, and the game moves it into the settings at its start. New test: `folder::tests::a_language_txt_stays_when_the_settings_cannot_be_read` (unreadable: the file stays; readable: the line is put and the file goes; a choice already there: kept, and the file goes). **L10:** unchanged, for the reason in my earlier reply. The build writes `language.txt` and its record milliseconds apart, so on a coarse clock an equal time is the build's own language. Treating it as a menu choice would bring back L3, where a build's default becomes a permanent preference. A player who chose in the same two-second tick as the build would have to pick it again once. The test pins this. **L7:** still to run, as listed under Still to test. Checks: `cargo test -p build-driver language` passes; clippy is clean on the two changed files. Clippy's two `needless_borrows_for_generic_args` errors in `build-compile/src/lib.rs` come from main; this PR doesn't touch that file.
Author
Member
@review
BeanBot left a comment

Recommendation: Approve. The builder now preserves the legacy language file when profile settings cannot be read, but the real first-update and Linux profile runs remain outstanding. A flat-folder update also leaves the preserved file where the updated game cannot read it. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge.

The change keeps the game language in player settings across builds and migrates older choices. The latest fix retains the legacy file on a settings read failure, though flat-folder migration needs further handling.

Should fix (2): not blocking, but worth doing before merging.

  • L10 builder/crates/build-driver/src/folder.rs:658: Equal modification timestamps cause a real menu choice to be discarded. When: On a filesystem with two-second timestamp resolution, a player can change the language shortly after a build writes its record. If both timestamps fall in the same interval, the comparison returns None and the next update overwrites the chosen language. Do: Handle ambiguous equal timestamps without silently discarding the player's choice, and cover that case in the migration tests.
  • L12 builder/crates/build-driver/src/folder.rs:730: A retained legacy file in a flat folder is no longer visible to the updated game after the install organizes the folder. (more on the line) Do: Preserve the file at the path the updated game reads, or make the startup migration and fallback also find a retained root file.

Testing before merging (1) (runs on the systems it can change; it doesn't hold the recommendation)

  • L7: The first update from an older game and the Linux profile path still need their recorded runs. When: The existing Windows run starts with game_language already in settings.ini, so it does not exercise the builder migration or the Linux host path. Do: Run the described old-game update on Windows and the settings override on Linux, recording the resulting language and settings.

@fix can do L10 and L12.

Since the last review (on 6b5b4151bd)
Resolved: L11 (The builder removes the legacy language file even when it could not read the profile setti…)
Still open: L7 (The first update from an older game and the Linux profile path still need their recorded r…); L10 (Equal modification timestamps cause a real menu choice to be discarded.)
New: L12 (A retained legacy file in a flat folder is no longer visible to the updated game after the…)

Checks: Still running: 7 checks.

More: does it help, other systems, switches, what was read

Does it help: Unproven for the complete migration: the reported Windows game runs and game-free tests show settings precedence and migration working, but the real first update through the launcher and the Linux profile run have not been recorded.

Other systems: The builder and startup paths affect Windows and Linux, profile and non-profile builds, and flat and organized game folders. Windows startup and builder tests are reported; the Linux profile run and real launcher update remain outstanding.

Switches: HOS_LANGUAGE remains a one-run override; no switch default changed. The switches.def change updates language help text.

Reviewed: 22d2220eaf against b6d274d779: Read the repository guidance and pull request template, the incremental diff, the relevant builder migration code and its startup readers. Skimmed the full-change statistics, recorded runs, comments and reviews; the rest of the changed files were not read in full. docs/review-checklist.md was absent.; nothing run (a code review).

Checked and fine:

  • A readable settings file with a choice keeps that choice before the leftover is removed.
  • A failed settings write returns an error before legacy-file removal.
  • The latest fix does not remove the settings-based language feature.

Testing: No commands that build or run project code were executed. The author reports builder language tests and Windows game runs; CI is still running.

Overlaps and merge order: LongshotLauncher#364 supplies the corresponding launcher language setting and update behavior.


Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.

**Recommendation: Approve.** The builder now preserves the legacy language file when profile settings cannot be read, but the real first-update and Linux profile runs remain outstanding. A flat-folder update also leaves the preserved file where the updated game cannot read it. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge. The change keeps the game language in player settings across builds and migrates older choices. The latest fix retains the legacy file on a settings read failure, though flat-folder migration needs further handling. **Should fix (2)**: not blocking, but worth doing before merging. - **L10** `builder/crates/build-driver/src/folder.rs:658`: Equal modification timestamps cause a real menu choice to be discarded. *When:* On a filesystem with two-second timestamp resolution, a player can change the language shortly after a build writes its record. If both timestamps fall in the same interval, the comparison returns None and the next update overwrites the chosen language. **Do:** Handle ambiguous equal timestamps without silently discarding the player's choice, and cover that case in the migration tests. - **L12** `builder/crates/build-driver/src/folder.rs:730`: A retained legacy file in a flat folder is no longer visible to the updated game after the install organizes the folder. (more on the line) **Do:** Preserve the file at the path the updated game reads, or make the startup migration and fallback also find a retained root file. **Testing before merging (1)** (runs on the systems it can change; it doesn't hold the recommendation) - **L7**: The first update from an older game and the Linux profile path still need their recorded runs. *When:* The existing Windows run starts with game_language already in settings.ini, so it does not exercise the builder migration or the Linux host path. **Do:** Run the described old-game update on Windows and the settings override on Linux, recording the resulting language and settings. `@fix` can do L10 and L12. **Since the last review** (on 6b5b4151bdba) Resolved: L11 (The builder removes the legacy language file even when it could not read the profile setti…) Still open: L7 (The first update from an older game and the Linux profile path still need their recorded r…); L10 (Equal modification timestamps cause a real menu choice to be discarded.) New: L12 (A retained legacy file in a flat folder is no longer visible to the updated game after the…) **Checks:** Still running: 7 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven for the complete migration: the reported Windows game runs and game-free tests show settings precedence and migration working, but the real first update through the launcher and the Linux profile run have not been recorded. **Other systems:** The builder and startup paths affect Windows and Linux, profile and non-profile builds, and flat and organized game folders. Windows startup and builder tests are reported; the Linux profile run and real launcher update remain outstanding. **Switches:** HOS_LANGUAGE remains a one-run override; no switch default changed. The switches.def change updates language help text. **Reviewed:** 22d2220eafb9 against b6d274d779da: Read the repository guidance and pull request template, the incremental diff, the relevant builder migration code and its startup readers. Skimmed the full-change statistics, recorded runs, comments and reviews; the rest of the changed files were not read in full. docs/review-checklist.md was absent.; nothing run (a code review). **Checked and fine:** - A readable settings file with a choice keeps that choice before the leftover is removed. - A failed settings write returns an error before legacy-file removal. - The latest fix does not remove the settings-based language feature. **Testing:** No commands that build or run project code were executed. The author reports builder language tests and Windows game runs; CI is still running. **Overlaps and merge order:** LongshotLauncher#364 supplies the corresponding launcher language setting and update behavior. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.</sub>
@ -638,0 +727,4 @@
/// copy of it is never deleted. What was done, and the names removed.
pub fn settle_language(out: &Path, settings: &Path, code: &str) -> Result<(Placed, Vec<&'static str>)> {
let placed = put_language(settings, code)?;
let gone = if placed == Placed::Unreadable { Vec::new() } else { remove_language_txt(out)? };
Member

L12 (should fix): A retained legacy file in a flat folder is no longer visible to the updated game after the install organizes the folder.

When: An older flat build has its menu choice in root language.txt and the profile settings cannot be read. The updated build retains that root file, but the organized game looks only in config/language.txt, so it starts without the retained choice.

Do: Preserve the file at the path the updated game reads, or make the startup migration and fallback also find a retained root file.

**L12** (should fix): A retained legacy file in a flat folder is no longer visible to the updated game after the install organizes the folder. *When:* An older flat build has its menu choice in root language.txt and the profile settings cannot be read. The updated build retains that root file, but the organized game looks only in config/language.txt, so it starts without the retained choice. **Do:** Preserve the file at the path the updated game reads, or make the startup migration and fallback also find a retained root file.
fix(builder): a language.txt kept in a flat folder moves where the organized game reads it
Some checks failed
PR description / Title and description (pull_request_target) Successful in 11s
CI / What the change needs (pull_request) Successful in 12s
CI / Third-party parts and guide screenshots (pull_request) Successful in 16s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Successful in 19s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Failing after 3m15s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 2m6s
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Successful in 4m12s
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Successful in 4m20s
CI / Website build and checks (pull_request) Failing after 1m42s
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Failing after 18m30s
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Failing after 30m23s
537f01abc7
Review of #2794 (L12): when the profile's settings could not be read, the build kept an older game's
language.txt (L11), but a flat folder's was at its root, and the build organizes the folder: the updated
game reads config/language.txt only, so it started without the kept choice. settle_language now moves a
root language.txt into config/ when the folder is organized and config/ has none.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Member

Thanks. L12 is fixed in 537f01abc. When the settings can't be read and the build keeps an older game's language.txt, settle_language now moves a flat folder's root file into config/language.txt once the build has organized the folder, which is where the updated game reads it. It does so only when config/ has none. a_language_txt_stays_when_the_settings_cannot_be_read covers it: a flat folder organized by the build, with a root ja file and unreadable settings, ends with config/language.txt saying ja and no root file. cargo test -p build-driver language passes, and clippy is clean on build-driver apart from main's two build-compile errors.

L10: unchanged, as answered before.

Thanks. **L12** is fixed in `537f01abc`. When the settings can't be read and the build keeps an older game's `language.txt`, `settle_language` now moves a flat folder's root file into `config/language.txt` once the build has organized the folder, which is where the updated game reads it. It does so only when `config/` has none. `a_language_txt_stays_when_the_settings_cannot_be_read` covers it: a flat folder organized by the build, with a root ja file and unreadable settings, ends with `config/language.txt` saying ja and no root file. `cargo test -p build-driver language` passes, and clippy is clean on `build-driver` apart from main's two `build-compile` errors. **L10:** unchanged, as answered before.
Author
Member
@review
BeanBot left a comment

Recommendation: Approve. The flat-folder migration now puts a retained legacy language file where the updated game reads it. The older-game update and Linux profile runs are still outstanding, and CI is running. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge.

The change keeps the player's game language in profile settings across builds and updates, while migrating legacy choices. It adds migration logic and retains an ambiguity when legacy file timestamps are equal.

Should fix (1): not blocking, but worth doing before merging.

  • L10 builder/crates/build-driver/src/folder.rs:658: Equal modification timestamps cause a real menu choice to be discarded. When: On a filesystem with two-second timestamp resolution, a player can change the language shortly after a build writes its record. If both timestamps fall in the same interval, the comparison returns None and the next update overwrites the chosen language. Do: Handle ambiguous equal timestamps without silently discarding the player's choice, and cover that case in the migration tests.

Testing before merging (1) (runs on the systems it can change; it doesn't hold the recommendation)

  • L7: The first update from an older game and the Linux profile path still need their recorded runs. When: The existing Windows run starts with game_language already in settings.ini, so it does not exercise the builder migration or the Linux host path. Do: Run the described old-game update on Windows and the settings override on Linux, recording the resulting language and settings.

@fix can do L10.

Since the last review (on 22d2220eaf)
Resolved: L12 (A retained legacy file in a flat folder is no longer visible to the updated game after the…)
Still open: L7 (The first update from an older game and the Linux profile path still need their recorded r…); L10 (Equal modification timestamps cause a real menu choice to be discarded.)

Checks: Still running: 7 checks.

More: does it help, other systems, switches, what was read

Does it help: Yes: the reported Windows game runs opened the Chinese and Japanese text packs from profile settings, and the author reports game-free tests that fail on the earlier code and pass with the fix. The real launcher update from an older game and the Linux profile run remain untested.

Other systems: The builder and host paths affect Windows and Linux, profile and profile-free launches, and flat and organized game folders. The reported Windows runs cover startup and settings migration; the Linux profile run and real older-game launcher update remain outstanding.

Switches: HOS_LANGUAGE remains a one-run override; its documented default changes to the settings' game_language, otherwise English. No switch is added or removed.

Reviewed: 537f01abc7 against b6d274d779: Read the change since the ledger in full, the relevant language migration and settings-carry code, repository instructions, contributing guide, pull request template, comments and reviews. The full pull request diff and all changed files were not read in full; the recorded test results were skimmed. The referenced Tooling AGENTS.md was unavailable locally.; nothing run (a code review).

Checked and fine:

  • The retained file is moved only after the settings are found unreadable, preserving the legacy choice for the game.
  • The added fixture covers a retained root language file after a flat folder becomes organized.

Testing: No commands that build, run tests, or execute project code were run. The author reports the builder language tests pass; the requested real update and Linux runs remain outstanding, and CI has not finished.

Overlaps and merge order: LongshotLauncher#364 supplies the associated launcher language controls; the description says the new launcher plays only builds with the game_language feature.


Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.

**Recommendation: Approve.** The flat-folder migration now puts a retained legacy language file where the updated game reads it. The older-game update and Linux profile runs are still outstanding, and CI is running. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge. The change keeps the player's game language in profile settings across builds and updates, while migrating legacy choices. It adds migration logic and retains an ambiguity when legacy file timestamps are equal. **Should fix (1)**: not blocking, but worth doing before merging. - **L10** `builder/crates/build-driver/src/folder.rs:658`: Equal modification timestamps cause a real menu choice to be discarded. *When:* On a filesystem with two-second timestamp resolution, a player can change the language shortly after a build writes its record. If both timestamps fall in the same interval, the comparison returns None and the next update overwrites the chosen language. **Do:** Handle ambiguous equal timestamps without silently discarding the player's choice, and cover that case in the migration tests. **Testing before merging (1)** (runs on the systems it can change; it doesn't hold the recommendation) - **L7**: The first update from an older game and the Linux profile path still need their recorded runs. *When:* The existing Windows run starts with game_language already in settings.ini, so it does not exercise the builder migration or the Linux host path. **Do:** Run the described old-game update on Windows and the settings override on Linux, recording the resulting language and settings. `@fix` can do L10. **Since the last review** (on 22d2220eafb9) Resolved: L12 (A retained legacy file in a flat folder is no longer visible to the updated game after the…) Still open: L7 (The first update from an older game and the Linux profile path still need their recorded r…); L10 (Equal modification timestamps cause a real menu choice to be discarded.) **Checks:** Still running: 7 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Yes: the reported Windows game runs opened the Chinese and Japanese text packs from profile settings, and the author reports game-free tests that fail on the earlier code and pass with the fix. The real launcher update from an older game and the Linux profile run remain untested. **Other systems:** The builder and host paths affect Windows and Linux, profile and profile-free launches, and flat and organized game folders. The reported Windows runs cover startup and settings migration; the Linux profile run and real older-game launcher update remain outstanding. **Switches:** HOS_LANGUAGE remains a one-run override; its documented default changes to the settings' game_language, otherwise English. No switch is added or removed. **Reviewed:** 537f01abc7ec against b6d274d779da: Read the change since the ledger in full, the relevant language migration and settings-carry code, repository instructions, contributing guide, pull request template, comments and reviews. The full pull request diff and all changed files were not read in full; the recorded test results were skimmed. The referenced Tooling AGENTS.md was unavailable locally.; nothing run (a code review). **Checked and fine:** - The retained file is moved only after the settings are found unreadable, preserving the legacy choice for the game. - The added fixture covers a retained root language file after a flat folder becomes organized. **Testing:** No commands that build, run tests, or execute project code were run. The author reports the builder language tests pass; the requested real update and Linux runs remain outstanding, and CI has not finished. **Overlaps and merge order:** LongshotLauncher#364 supplies the associated launcher language controls; the description says the new launcher plays only builds with the game_language feature. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.</sub>
Author
Member

On "does it really need a rebuild to update the language?": no. With MagicBeanDev/Longshot#2794 the language is no longer part of the build:

  • The game reads game_language= from the profile's settings.ini at every start (HOS_LANGUAGE still overrides it for one run). A change applies at the next start of the same build.
  • It is out of the profile's build key (Profile::key in play.rs), so play's fast check never rebuilds for a language change. build --profile --language X on a current folder only updates profile.json.
  • The ways to change it are writes to that one line, with no build: the Insert menu's Game language row, and MagicBeanDev/LongshotLauncher#364's Game language row on the Profiles page.

Builds touch it only twice:

  • a profile's first build by this builder writes the line when the profile has none (the starting language);
  • the first update of a folder an older game built carries a language chosen in that game's menu (kept in language.txt) into the line once.

In #364 the update wizard's Game language is only applied as part of an update the player is already running. Nothing in the launcher builds for a language change.

On "does it really need a rebuild to update the language?": no. With MagicBeanDev/Longshot#2794 the language is no longer part of the build: - The game reads `game_language=` from the profile's `settings.ini` at every start (`HOS_LANGUAGE` still overrides it for one run). A change applies at the next start of the same build. - It is out of the profile's build key (`Profile::key` in `play.rs`), so play's fast check never rebuilds for a language change. `build --profile --language X` on a current folder only updates `profile.json`. - The ways to change it are writes to that one line, with no build: the Insert menu's Game language row, and MagicBeanDev/LongshotLauncher#364's Game language row on the Profiles page. Builds touch it only twice: - a profile's first build by this builder writes the line when the profile has none (the starting language); - the first update of a folder an older game built carries a language chosen in that game's menu (kept in `language.txt`) into the line once. In #364 the update wizard's Game language is only applied as part of an update the player is already running. Nothing in the launcher builds for a language change.
HumanBean deleted branch fix/game-language-in-options 2026-11-29 19:25:27 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
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
MagicBeanDev/Longshot!2794
No description provided.