fix(menu): the game's language is kept with the player's settings, so an update keeps it #2794
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/mods
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!2794
Loading…
Reference in a new issue
No description provided.
Delete branch "llun/Longshot:fix/game-language-in-options"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.txtin 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'ssettings.ini, which no build writes over a choice.language.txtis 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 hasgame_language=, so this migration happens now rather than after the next stable release.HOS_LANGUAGEstill 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.chos_language_move(called inhost/hos_main.cright after the settings carry, before the game or the menu reads the language): alanguage.txta build from before left in the game folder is moved into the settings once. Its language is added asgame_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.cdesired_language:HOS_LANGUAGE, else the settings'game_language, else such a leftover, else English (US). No first-startlanguage.txttemplate 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 profilesettings.iniholding onlygame_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.build.rs,folder.rsput_language,settings_path,remove_language_txt,menu_language): a build writes nolanguage.txt. It puts a language in the settings only when they hold nogame_language=: the profile'ssettings.ini, or without--profilethe settings the game then reads (config/settings.ini, a flat folder'slongshot_options.ini). The language is the one an older game's menu chose (alanguage.txtnewer than the folder's build record, in a folder whose record lacks thegame_languagefeature), else the build's (--language, the profile'sprofile.jsonlanguage, else the system's). A leftoverlanguage.txtis 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.txtis no longer the player's data (a leftover is reported as an extra and left alone).language.txt(its 13 translations shortened the same way). Player and developer docs say where the language is kept; CONTRIBUTING andassets/saves/README.mdkeeplanguage.txtbanned 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 whosesettings.iniheld onlygame_language=zh-Hans, over a build whoselanguage.txtsaysen-US:3ab4db6e9:oe: language en-US (language.txt); the game openedMals/USen.b3cbc4d59(after the review's fixes), on main01d6878b3:oe: language zh-Hans (game_language in the settings); the game openedMals/CNzh; the game folder'sconfig/settings.iniwas copied into the profile once (options: the settings in ... were copied to ...) with the onegame_language=zh-Hansline kept; the run stopped withstop: close work done.01d6878b3:oe: language zh-Hans (game_language in the settings); the game openedMals/CNzh, the run stopped withstop: close work done, and the game's own settings save keptgame_language=zh-Hansin the profile.game_language=zh-Hansinto a profile'ssettings.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 coversdesired_languagecut fromnn_applet.cand compiled, the menu's language functions cut fromvk_menu_i18n.cppand compiled, andoptions_path.c's one-time copy built whole. The whole suite,tests/run_all.pyon 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 @01d6878b3on 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_reportandbyte_compile_tracked(it needs git, which can't read this worktree from WSL; it passes on Windows). The 30th,test_menu_env_overrides, cutssave()and lacked a stand-in for the newgame_language_choice: it has one now and passes. Every check that reads a changed file (run_all.py --changed, 38) passes, plustest_game_language,test_options_path,test_settings_atomic,test_menu_i18n_countandtest_menu_restart. The builder's newan_update_keeps_the_language_chosen_in_the_gamepasses, andcargo clippy -p build-driveris clean.After review (
b3cbc4d59):test_game_languagegained 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 head339f528f6for those reasons and pass here (gcc and clang). The builder's new end-to-endan_update_from_an_older_game_keeps_the_language_its_menu_chose(driver.rs: a flat older folder, a profile with nosettings.ini, then a second update) fails on339f528f6(left: None) and passes here;cargo test -p build-driver(160 + 7 + 4 passed),cargo clippy -p build-driver --all-targets -D warningsandcargo fmt --check -p build-driverare clean. Every checkrun_all.py --changedpicks (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-sourcesandtest_guide_screenshots.pypass:settings-graphics.pngis kept, its review recorded (Graphics, Audio and Controls rendered with the UI-only helper from main and from4d6d3547differ only in the version text's box).cargo fmt --checkflags onlybuild-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'slanguage.txtcounts as the menu's only when it is newer than the folder's build record.an_update_keeps_the_language_chosen_in_the_gameandan_update_from_an_older_game_keeps_the_language_its_menu_chosenow cover a player who never chose: alanguage.txtthe older build wrote, then an update with another language, writes nogame_language=. They fail onb3cbc4d59for that (the build's own language.txt, and asettings.iniwritten) and pass here.cargo test -p build-driver(160 + 7 + 4 passed), clippy (-D warnings) andcargo fmt --checkare clean. Only the builder changed, so the game run above still holds.After futondestroyer's review (
c8b4ec305, rebased on mainf14a5664d): three new cases fail on9f1b01617for 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; on9f1b01617the profile got nothing,left: None).test_game_language: a profilesettings.inithat can't be read (a folder in its place) is left alone, with no copy tried (on9f1b01617the copy was tried over it). And with no choice, the row'slanguage.txtfallback is read once (on9f1b01617a 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'sbuild-compile, from #2782) andcargo fmt --checkare clean. Every checkrun_all.py --changedpicks (144), on WSL: 117 passed, 8 failed, 19 skipped; the 8 fail the same way on main: the 7 above andtest_keyboard_option(new on main with #152, failing there with "the host cannot see the Keyboard row"). The guide check passes again: rendered from mainf14a5664and fromb7f2825c, the pages differ only in the version text's box, recorded in the manifest. In the game, @c8b4ec305over the shared base, through the queue: the throwaway profile with onlygame_language=zh-Hansgaveoe: language zh-Hans (game_language in the settings),Mals/CNzh, the game folder's settings copied in once with the one line kept, andstop: close work done. A profile whosesettings.iniwas a folder gaveoptions: ...settings.ini could not be read: left as it is, the game folder's settings not put over it, the game inlanguage.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 atc8b4ec305still holds.mise run teston Windows (llvm-mingw, MSYS2's gcc, g++, glslang and spirv-val on PATH) @ 283a779de, on main01539efd2: 807 passed, 48 failed, 47 skipped. 46 of the 48 fail the same way on main01539efd2on this PC. The other 2,test_dev_abandtest_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_atomicandtest_menu_env_overridespass on Windows at9ef12bc71.After removing
language.txt(the maintainer's call;6b5b4151b, on mainb6d274d77): the new cases fail on9ef12bc71and pass here. Intest_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 nolanguage.txtand seeds a profile with no choice,--languagewithout a profile goes intoconfig/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) andcargo fmt --checkpass.-p longshot-builderhas 6 failures and-p build-compile2 toolchain ones, the same that fail on mainb6d274d77on 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):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 keptgame_language=zh-Hans, and the run stopped cleanly.game_language=ja:oe: language ja (game_language in the settings),Mals/JPja, a clean stop.Still to test:
settings.inito gaingame_language=zh-Hans(the builder's log linethe game's language chosen in its menu (zh-Hans) kept in .../settings.ini (game_language), naming the profile's settings.ini, and nolanguage.txtleft in the game folder). The same with the update asking for 简体中文, then a second one asking for English: the profile keepsgame_language=zh-Hansand the game to start in Chinese.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
game_language=, and that is what the game reads.language.txtwritten 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 thegame_languagefeature.HOS_LANGUAGEstill overrides it for one run.language.txt, which builds no longer write. The new launcher plays only builds of a builder that hasgame_language=(the maintainer's call).language.txtagain.Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named).main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
mainand passes here.tests/that reads changed source is updated, not weakened.Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.🤖 Generated with Claude Code
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.Possibly related, for context:
WIP: fix(menu): the game's language is kept with the player's settings, so an update keeps itto fix(menu): the game's language is kept with the player's settings, so an update keeps it@review
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.
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.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.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.CI / Third-party parts and guide screenshots (pull_request)fails on this head and passes on the base branch: Failing after 16s.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.
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.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.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)
@fixcan 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:
339f528f6eagainst01d6878b3f: 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:
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.
@ -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.profileL2 (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 {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 {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();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;) {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: E402RUN_ALL_ARGS = ["--cc", "gcc", "--cxx", "g++"]ROOT = Path(__file__).resolve().parents[1]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]>Thanks for the review. Fixed in
61b1cd862(the tests, which fail on the old head339f528f6) and4d6d35476(the fixes), plusb3cbc4d59(the guide picture's review). Point by point:settings.iniin the profile): fixed.keep_chosen_languagenow writes asettings.iniholding onlygame_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).build.rsnow reads it with the newfolder::menu_languageright wherelanguage()reads the folder's language, before anything is installed, and passes it on. A flat folder's rootlanguage.txtcounts.game_languagefeature (game/features.txt, kept in the build record). Only a folder whose record lacks it can have alanguage.txtthat its game's menu wrote. A game withgame_language=never writes that file. So the migration happens at most once, on the first update to this version. After that, the folder'slanguage.txtis 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.game_lang_tickreads the line back from the settings file aftersave()(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 saysmenu: the settings could not be saved: the game language at the next start stays .... I keptsave()'s signature, since 17 checks cut it asvoid save() {.copy_addingchecksferrorand writes nothing when a read failed, so the profile's file stays as it was and the next start copies again.RUN_ALL_ARGS = ["--cc", "{cc}", "--cxx", "{cxx}"], parsed withtests/compiler_command.py'sparse_compiler, and the check skips when no compiler is found.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 nosettings.ini. A real update by hand and the Linux run still need their recorded runs.settings-graphics.png. Seven of its UI sources changed: this PR's menu files, andgame/oot_cheat_items.hfrom #2785, which flags on main too. I rendered Graphics, Audio and Controls with the UI-only helper from main01d6878band from4d6d3547. 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-sourcesandtest_guide_screenshots.pypass, and so doescheck_third_party.py.tests/test_settings_atomic.py: an unusedimport sys, which main has too and which shows once the file changes. Removed.save()writesgame_language=whenever there is a choice. Every way it can fail (read-only file,.newnot 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;
b3cbc4d59as a pack over the shared base, through the job queue, headless). A profile whosesettings.iniheld onlygame_language=zh-Hans, over a build whoselanguage.txtsaysen-US, gaveoe: language zh-Hans (game_language in the settings)and openedMals/CNzh. The game folder's settings were copied into the profile once, with the onegame_language=zh-Hansline kept, and the run stopped withstop: close work done.Checks:
test_game_languagepasses with gcc and with clang.cargo test -p build-driverpasses, and clippy (-D warnings) andcargo fmt --checkare clean. Of the 142 checksrun_all.py --changedpicks, 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.@review
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.
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)
@fixcan 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 checkCI / 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:
b3cbc4d590against01d6878b3f: 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:
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.
Thanks. L3 is fixed in
18f48bbac(the tests, which fail onb3cbc4d59) andf834d8aec(the fix); the head is9f1b01617.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) afterlanguage.txt: the install's note, then the finish. Nothing but a build writes the record, and a plain play doesn't. So alanguage.txtnewer 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_languagechecks this after thegame_languagefeature 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.txtwas written by the build, before its record. So nogame_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-driverpasses (160 + 7 + 4), and clippy (-D warnings) andcargo fmt --checkare clean. Only the builder changed in this round, so the game run in my last reply still holds.@review
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.
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)
@fixcan 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:
9f1b01617dagainst01d6878b3f: 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:
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.
@ -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 {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.
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.txtand 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, andan_update_keeps_the_language_chosen_in_the_gamesets 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) andcargo fmt --checkare clean. Only a test and a comment changed.llun referenced this pull request2026-11-29 12:20:00 +00:00
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.
language.txtopened, 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
b3cbc4d59exercised 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 headc1703bb238549194a832705f9d596e1d28c6475eagainst01d6878b3f148e68d7a9080133d193e1fb7c2973. 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 unresolvedtest_longshot_ctl.pyrelaunch timeout with subsequent failures. Windows test · CI · Launcher follow-up@ -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 {[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 instd::string game_language_next() {if (!game_language_chosen().empty()) return game_language_chosen();const std::string txt = read_language_txt();[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 lineis kept in it) */const int there = GetFileAttributesA(file) != INVALID_FILE_ATTRIBUTES;if (there && has_settings(file)) return;[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.
c1703bb238a865939d98Thanks for the review, all three points held. The branch is rebased onto main
f14a5664d.eb93ced08adds the tests, which fail on the reviewed headc1703bb23(as9f1b01617before the rebase) for the reasons you gave.b7f2825c0is the fix, andc8b4ec305re-records the guide picture's review after the rebase. Head:c8b4ec305.folder.rs): fixed.keep_chosen_languageno 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 testa_menu_choice_is_kept_when_the_first_update_asks_for_the_same_languageis your two-update case. The menu chose zh-Hans and the first update asks for zh-Hans: the profile getsgame_language=zh-Hans. The second update asks for en-US:language.txtsays 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.options_path.c): fixed.has_settingsnow returns -1 when the file can't be opened or a read fails before a setting is found, andlanguage_linesays whether it read the file whole. Either failure leaves the profile's file as it is, logsoptions: <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 ofsettings.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 inlanguage.txt's English, and the folder was untouched.language.txtread 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'sgame_language_saved()was. The read-back after an actual save (game_language_saved) stays. The test changeslanguage.txtafter 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,
c8b4ec305as a pack over the shared base, through the job queue, headless). The profile with onlygame_language=zh-Hans, over an en-USlanguage.txt, gaveoe: language zh-Hans (game_language in the settings)and openedMals/CNzh. The game folder's settings were copied in once with the one line kept, and the run stopped withstop: close work done. The unreadable-profile run is described above.Checks:
cargo test -p build-driverpasses (160 + 8 + 4), andcargo fmt --checkandcargo clippy -p build-driver --all-targets --no-deps -D warningsare clean. Without--no-deps, clippy now stops on main'sbuild-compile, from #2782.run_all.py --changedpicks, 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, andtest_keyboard_option, new on main with #152.b7f2825c, the pages differ only in the version text's box.test_longshot_ctl.pyrelaunch timeout you saw. This PR doesn't touch that code orlongshot_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.
c8b4ec30549ef12bc710Rebased onto main
b6d274d77(head9ef12bc71). 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 inb7f2825c0(now3951bb9dfafter the rebase).The whole suite,
mise run teston Windows with MSYS2's tools on PATH, at283a779deon main01539efd2: 807 passed, 48 failed, 47 skipped.01539efd2on this PC.test_dev_abandtest_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.test_game_language,test_options_path,test_settings_atomic,test_menu_env_overrides) pass on Windows at9ef12bc71.The two commits main gained since (#2790, #2803) touch only the Linux profiler and the Linux display, so the game run on
c8b4ec305still holds. In it, a zh-Hans profile over an en-US build started in Chinese, and an unreadable profile file was left alone.language.txtis gone in this PR now. This is the maintainer's call: the new launcher plays only builds of a builder that hasgame_language=, so the migration happens now instead of after the next stable release. The tests are in625a6849aand fail on the previous head. The fix is in477943544, the docs in878c90470, and the guide picture's review in6b5b4151b.What changed:
language.txt, and the game no longer makes one at its first start. Alanguage.txtthat a build from before left in the game folder is moved into the settings once at the start (host/options_path.chos_language_move, run right after the settings carry and before the game or the Insert menu reads the language). Its language is added asgame_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.game_language=yet, and never writes over a choice. That's the profile'ssettings.ini, or without--profilethe file the game then reads.--language, the profile'slanguage, else the system's.language.txtis removed. The language is no longer part of the build key, so changing it needs no rebuild.verifyno longer countslanguage.txtas the player's data; a leftover is reported as an extra and left alone.config/settings.ini(a flat folder'slongshot_options.ini), notfolder::options_path. In an organized folder that'sconfig/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):
language.txt:options: ...config/language.txt's language zh-Hans moved into ...settings.ini (game_language=), thenoe: language zh-Hans (game_language in the settings). The Chinese text pack (Mals/CNzh) opened, the leftover was gone afterwards, the profile keptgame_language=zh-Hans, and the run stopped cleanly.game_language=ja:oe: language ja (game_language in the settings), the Japanese text pack (Mals/JPja), and a clean stop.Checks:
test_game_languagepasses with gcc and clang.test_settings_atomicnow also checks thatdesired_languagewrites no file and that the move writes whole.cargo test -p build-driverpasses (160 + 9 + 4); clippy (--no-deps -D warnings) andcargo fmt --checkare clean.longshot-builderandbuild-compilehave failures, but exactly the same ones fail on mainb6d274d77on this PC (6 inlongshot-builder, 2build-compiletoolchain tests).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).@review
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.
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.
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)
@fixcan 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:
6b5b4151bdagainstb6d274d779: 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:
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.
@ -736,0 +762,4 @@folder::GAME_LANGUAGE_KEY));}let gone = folder::remove_language_txt(&p.out)?;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.
Thanks. L11 is fixed in
22d2220ea.put_languagenow tells apart the three outcomes (the language put there, a choice already there and kept, or settings that couldn't be read). The newsettle_languageremoves a leftoverlanguage.txtonly 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.txtand 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 languagepasses; clippy is clean on the two changed files. Clippy's twoneedless_borrows_for_generic_argserrors inbuild-compile/src/lib.rscome from main; this PR doesn't touch that file.@review
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.
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.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)
@fixcan 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:
22d2220eafagainstb6d274d779: 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:
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.
@ -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)? };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.
Thanks. L12 is fixed in
537f01abc. When the settings can't be read and the build keeps an older game'slanguage.txt,settle_languagenow moves a flat folder's root file intoconfig/language.txtonce the build has organized the folder, which is where the updated game reads it. It does so only whenconfig/has none.a_language_txt_stays_when_the_settings_cannot_be_readcovers it: a flat folder organized by the build, with a root ja file and unreadable settings, ends withconfig/language.txtsaying ja and no root file.cargo test -p build-driver languagepasses, and clippy is clean onbuild-driverapart from main's twobuild-compileerrors.L10: unchanged, as answered before.
@review
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.
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)
@fixcan 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:
537f01abc7againstb6d274d779: 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:
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.
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:
game_language=from the profile'ssettings.iniat every start (HOS_LANGUAGEstill overrides it for one run). A change applies at the next start of the same build.Profile::keyinplay.rs), so play's fast check never rebuilds for a language change.build --profile --language Xon a current folder only updatesprofile.json.Builds touch it only twice:
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.