feat(profiles): a profile's game language, kept with its settings so an update keeps it #364
No reviewers
Labels
No labels
area/build
area/install
area/mods
area/saves
area/tooling
area/ui
area/updates
ci: approved
good first issue
gpu/amd
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
platform/linux
platform/steam-deck
platform/windows
priority
critical
priority
high
priority
low
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/LongshotLauncher!364
Loading…
Reference in a new issue
No description provided.
Delete branch "llun/LongshotLauncher:feat/profile-game-language"
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?
A player reported that their game, set to Chinese, went back to English after every update through the new launcher (the old one kept it). There were two causes. The update wizard pre-fills the game language from the version's
language.txt, but read the whole file as the code. The builder and the game write a comment and the list of codes around the code line, so the read never matched, and the wizard fell back to the language last picked in the launcher (English for most) and passed it as--language. Andlanguage.txtis a build file, so any update that names a language overwrites a choice made in the game's menu.The game now keeps the player's language in the profile's own settings,
game_language=<code>in itssettings.ini, which no build writes and which the game reads overlanguage.txt: MagicBeanDev/Longshot#2794. This PR gives the launcher the same setting.What changed:
Settings → Game: a Game language row for the current profile. It writes that profile's
settings.inigame_language=line and keeps the game's other lines as they are (src/players/language.rs); the game reads it at its next start, so no build is needed. It's refused while a game plays that profile, since the game would write its settings back over it. The check runs under the profile's edit lock, which the builder'splayalso takes before it starts the game. While this launcher's game plays, the row is disabled and says "Close the game first.". It shows the current profile's choice (and follows a profile switch), else the language the game of the profile's version is in now (an older build'slanguage.txt), else the language its builds are asked for (profile.json'slanguage), else en-US.The build wizard: its Game language starts on the profile's choice, else the language the version's game is in now.
language.txtis now read as the game reads it: the first line that isn't blank or a comment, a BOM or CRLF allowed, any case (builder_cli::built_language). After a build of the profile's own version (not an update of another one), a profile that has a choice takes the wizard's, so the two never disagree; under the same edit lock and running-game check, and left as it is while a game plays the profile. A profile with no choice is left as it is: the builder of Longshot#2794 puts the line there at the end of a build when there is none.language.txt removed (Longshot#2794, the maintainer's call: the new launcher only runs builds of the new builder): a build whose record has the
game_languagefeature has nolanguage.txt. A new install that copies an identical build (the builder doesn't run then) puts the language asked for into the profile'ssettings.iniwhen it has none, as the builder would, instead of writing alanguage.txtthe game no longer reads. A copy of an older build keeps itslanguage.txt.Language names: both Game language dropdowns (Settings → Game and the update wizard) list each language by its own name, as the game's menu does (Español (Latinoamérica), 简体中文, 日本語), instead of codes like
es-419orzh-Hans; the codes stay what is saved and passed to the builder (game::LANGUAGE_NAMES,ui/game-language.slint).The launcher's own language still never decides the game's.
Tested on Windows 11, by hand, with a separate launcher home (
LONGSHOT_LAUNCHER_HOME) holding a copy of an installed nightly-880 whoselanguage.txtsaid zh-Hans, and the wizard's saved language en-US:6ae8497: Versions → Update → Advanced showed Game language en-US (the bug).game_language=jathe same way) wrotegame_language=zh-Hansinto the profile'ssettings.ini, and the page showed "Profile options: Saved". A screenshot is in the first comment.settings.iniheld only that line over a build whoselanguage.txtsaid en-US, started in Chinese:oe: language zh-Hans (game_language in the settings), the Chinese text pack opened. main's game started in English there.Checks: new
players::language::tests::the_profile_keeps_its_game_language_in_its_settings(with a game playing: nothing written),wizard::tests::updating_an_inactive_version_uses_its_source_and_preserves_profile_defaultsextended (the profile's language stays) andreuse_tests::copies_verified_artifacts_without_sharing_files_or_profile_dataextended (agame_languagebuild: nolanguage.txt, the profile seeded); both are Unix-only, so CI's Linux job runs them, andbuilder_cli::tests::an_update_keeps_the_language_the_player_chose_in_the_game, which fails on main (the whole file comes back instead ofzh-Hans).cargo fmt --checkandcargo clippy --locked --workspace --all-targets -D warningsare clean;test_release.pypasses.cargo testpasses but for the same Windows folder and link tests that fail on main on this PC:folders::tests::*(3),game::recovery,game::registry(3),game::releases,game::steam::library,home::tests::moving_a_portable_install…,storage::reclaim::preservation,storage::tests::only_current_installed_versions…. None of them touches this change.Not tested here: an update from the launcher to a game build that has
game_language=(none is released yet; it needs MagicBeanDev/Longshot#2794 in a nightly). With an older game, the row's choice is saved but that game still readslanguage.txt.🤖 Generated with Claude Code
Tested in game: Windows 11, RTX 5080, NVIDIA 621.40, a separate launcher home: Profiles -> Game language -> zh-Hans wrote game_language=zh-Hans into the profile's settings.ini; with that line the game of MagicBeanDev/Longshot#2794 started in Chinese (oe: language zh-Hans (game_language in the settings)). On main the update wizard pre-filled en-US for a version whose language.txt said zh-Hans.
Before, main @
6ae8497: Versions → Update → Advanced pre-fills Game language en-US for a version whose language.txt says zh-Hans.Here: Profiles → Game language → zh-Hans, saved to the profile's settings.ini (Profile options: Saved).
Possibly related, for context:
WIP: feat(profiles): a profile's game language, kept with its settings so an update keeps itto feat(profiles): a profile's game language, kept with its settings so an update keeps it@review
Recommendation: Request changes. Updating an inactive version can change the active profile’s language, and a new build can overwrite settings while that profile is playing. The profile row can also show English for a game built in another language.
The launcher reads formatted language files and lets players save a language per profile. The parser addresses the reported update fallback, but the new profile writes need to respect which version is being updated and whether the profile is in use.
Blocking (2): must change before merging.
src/game/wizard.rs:666: Updating an inactive installation also changes the active profile’s saved language. (more on the line) Do: Only synchronize the profile language when the built installation is the profile’s current installation, using the same ownership check as remember_build_options.src/game/wizard.rs:666: A new installation can rewrite a profile’s settings while its game is running. (more on the line) Do: Protect the settings update against a running game for both new builds and updates, and coordinate the check and write with the game’s profile-use lock.Should fix (2): not blocking, but worth doing before merging.
src/players/rows.rs:42: The fallback does not reliably show the language of the profile’s game. (more on the line) Do: Resolve the profile’s selected version and read its built language when there is no profile choice, falling back to en-US only when that cannot be determined.ui/profiles.slint:304: The disabled language control does not explain why it cannot be changed while a game is playing. (more on the line) Do: Show a localized explanation beside the disabled control while the game is running.Testing before merging (1) (the change behaves the same on every system: one run of the change itself is enough; it doesn't hold the recommendation)
@fixcan do L1, L2, L3 and L4.Checks: Still running:
CI / Rust formatting, lint and tests (pull_request),CI / Release packages and stable upgrades (pull_request).More: does it help, other systems, switches, what was read
Does it help: Yes for the reported parser failure: the new test covers the formatted language file, and the author observed the old wizard selecting en-US for a zh-Hans build. The profile override was tested with Longshot#2794, but an end-to-end launcher update to a released game with that support has not yet been tested.
Other systems: The settings write affects games using the profile, including independently launched games. Older game builds ignore game_language; the profile override requires Longshot#2794. Windows was tested by the author; no Linux run was reported.
Switches: None.
Reviewed:
66b16349b3against6ae84979a2: Read AGENTS.md, CONTRIBUTING.md, the commit and diff, and the changed language and profile-row code; inspected the changed wizard, builder, player binding and Slint code and their relevant callers, locks and running-process checks. The large combined file output was truncated, so portions of the changed files outside those paths were only skimmed. No review checklist or pull request template was present.; nothing run (a code review).Checked and fine:
Testing: Read-only review; no tests or project commands were run. The author reports Windows manual testing and local checks; both CI jobs are still running.
Overlaps and merge order: Longshot#2794 supplies the game-side setting and must be available for the profile override to affect the game.
Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.
@ -658,6 +663,7 @@ fn build_and_register(}let selected = versions::selected(&p.ctx.home, Some(&folder))?;remember_build_options(p, options, &selected)?;players::language_follows_build(&p.ctx.profile, &options.language)?;L1 (blocking): Updating an inactive installation also changes the active profile’s saved language.
When: A profile with game_language=ja is using version A. The player updates inactive version B and selects fr; remember_build_options deliberately leaves the active profile alone, but language_follows_build changes its setting to fr, so version A next starts in French.
Do: Only synchronize the profile language when the built installation is the profile’s current installation, using the same ownership check as remember_build_options.
L2 (blocking): A new installation can rewrite a profile’s settings while its game is running.
When: New builds do not take the update-only ensure_paths_idle check. If the profile has a saved language and the wizard selects a different one while its game is running, follow_build writes settings.ini; the running game can subsequently overwrite that choice with its in-memory settings.
Do: Protect the settings update against a running game for both new builds and updates, and coordinate the check and write with the game’s profile-use lock.
@ -39,1 +39,4 @@let has_options = super::disk::is_file(&profile.dir.join("settings.ini"));// (the player's choice, else the language its builds are made in, else the game's default)let game_language = super::language::chosen(&profile.dir).or_else(|| data["language"].as_str().and_then(super::language::code))L3 (should fix): The fallback does not reliably show the language of the profile’s game.
When: A newly created profile inherits the active profile’s game path but no language field. If its selected build is Chinese and it has no game_language setting, this row falls back to en-US even though the game reads zh-Hans from language.txt.
Do: Resolve the profile’s selected version and read its built language when there is no profile choice, falling back to en-US only when that cannot be determined.
@ -287,0 +301,4 @@language := Dropdown {max-width: Ink.form-control-width;enabled: !root.player.damaged && !Game.playing;L4 (should fix): The disabled language control does not explain why it cannot be changed while a game is playing.
When: When Game.playing is true, the dropdown is disabled, so its callback cannot produce the error message and the profile page offers no explanation.
Do: Show a localized explanation beside the disabled control while the game is running.
Thanks. Fixed in
65a9fc3:remember_build_options, after its check that the build is the profile's own version, so an update of another version returns before it.updating_an_inactive_version_uses_its_source_and_preserves_profile_defaultsnow gives the profilegame_language=zh-Hans, picksfrfor the inactive version, and checks it stays zh-Hans.saves_idlefor the profile's folder) under the profile's edit lock, right before writing. The builder'splaytakes that same lock before it starts the game, so no play starts between the check and the write. The Profiles row refuses and says why; a build, new or update, leaves the profile's choice as it is and logs it.the_profile_keeps_its_game_language_in_its_settingscovers both refusing.language.txt, viagame::profile_built_language), else theprofile.jsonlanguage, else en-US.Checks: fmt and clippy (
-D warnings) clean; on Windowscargo testis unchanged (the same 12 Windows folder and link tests fail on main); the wizard's tests are Unix-only and run in CI.@review
Recommendation: Approve. The code is ready: only testing is left (a run of the change itself). The fixes preserve the profile language in the cases raised by the earlier review. The complete update workflow still needs a run with a game that reads the profile setting. Recommend approval; not approved on the forge.
The launcher saves a game language per profile and uses the installed game's language when preparing an update. The change adds profile-setting and process-check logic to preserve the player's choice.
Testing before merging (1) (the change behaves the same on every system: one run of the change itself is enough; it doesn't hold the recommendation)
Since the last review (on
66b16349b3)Resolved: L1 (Updating an inactive installation also changes the active profile’s saved language.); L2 (A new installation can rewrite a profile’s settings while its game is running.); L3 (The fallback does not reliably show the language of the profile’s game.); L4 (The disabled language control does not explain why it cannot be changed while a game is pl…)
Still open: L5 (The complete update workflow with a game that reads the profile setting has not been exerc…)
Checks: Still running:
CI / Rust formatting, lint and tests (pull_request),CI / Release packages and stable upgrades (pull_request).More: does it help, other systems, switches, what was read
Does it help: Unproven for the complete update workflow: the reported Windows run confirms the profile setting is written and the companion game reads it, but does not exercise an update with that game.
Other systems: The settings and running-game checks apply on Windows and Linux. The reported hands-on run was on Windows; the inactive-version test is Unix-only. Older game builds continue to read language.txt rather than the new profile setting.
Switches: None.
Reviewed:
65a9fc3b59against6ae84979a2: Read AGENTS.md, CONTRIBUTING.md, the complete diff and commit list, src/players/language.rs, src/players/rows.rs, and src/players/running.rs; inspected the relevant sections and callers in the other changed files. The remaining changed files and recorded test results were skimmed, not read in full. No review checklist or pull request template was present at the named paths.; nothing run (a code review).Checked and fine:
Testing: No commands that build or execute project code were run. The author reports Windows manual testing, formatting and lint checks; CI is still running. The complete update workflow remains untested with a game that reads the profile setting.
Overlaps and merge order: MagicBeanDev/Longshot#2794 supplies the game-side setting; a nightly containing it is needed for the outstanding workflow run.
Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.
65a9fc3b596696c2b107Rebased onto main
21a83d2and adapted to MagicBeanDev/Longshot#2794, which now removes language.txt (the maintainer's call: the new launcher only runs builds of the new builder). That builder writes no language.txt and putsgame_language=in the profile's settings at the end of a build when there is none.6696c2b: a new install that copies an identical build skips the builder, so for a build whose record has thegame_languagefeature it now seeds the profile'ssettings.inithe same way (only when there is no line) instead of writing alanguage.txtthat the game no longer reads andverifywould report as extra. A copy of an older build keeps itslanguage.txt. The reuse test covers both (Unix-only; CI's Linux job runs it). fmt and clippy are clean, and the language tests pass on Windows.@review
Recommendation: Approve. The profile language setting has been shown working with the game, but the complete update workflow with a released build that reads it has not yet been exercised. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge.
The launcher keeps a profile’s game language in its settings and uses it when preparing builds. Reused builds also seed that setting when needed, though that new write can race a running game.
Should fix (2): not blocking, but worth doing before merging.
src/players/language.rs:57: Seeding the profile does not check whether its game is running under the edit lock. (more on the line) Do: Check that the profile is idle under the edit lock before seeding, and leave its settings unchanged while the game is running.src/game/reuse.rs:221: The profile is seeded before the copied build is verified or committed. (more on the line) Do: Seed the profile only after the copied build has passed verification and is ready to be committed, with appropriate handling if the final commit fails.Testing before merging (1) (the change behaves the same on every system: one run of the change itself is enough; it doesn't hold the recommendation)
@fixcan do L6 and L7.Since the last review (on
65a9fc3b59)Still open: L5 (The complete update workflow with a game that reads the profile setting has not been exerc…)
New: L6 (Seeding the profile does not check whether its game is running under the edit lock.); L7 (The profile is seeded before the copied build is verified or committed.)
Checks: Still running:
CI / Rust formatting, lint and tests (pull_request),CI / Release packages and stable upgrades (pull_request).More: does it help, other systems, switches, what was read
Does it help: Unproven: the reported Windows test shows the profile setting starts the game in Chinese, but does not exercise an update to a released game build that reads the setting.
Other systems: The setting is shared with the game and the builder. The copied-build path can write it while the profile’s game is running; the end-to-end update remains untested.
Switches: None.
Reviewed:
6696c2b107against21a83d2b44: Read AGENTS.md, CONTRIBUTING.md, the full diff, and the reused-build and profile-language implementations and reuse test in full. Other changed files and their surrounding paths were inspected through the diff and targeted searches.; nothing run (a code review).Checked and fine:
Testing: The author reports Windows profile and game tests and passing language tests. CI is still running; no commands or tests were run for this review.
Overlaps and merge order: Longshot #2794 supplies the game and builder support required for the new profile setting.
Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.
@ -227,0 +218,4 @@if feature("game_language") {// The game reads its language from the profile's settings, and no build writes a language.txt: the language// asked for goes there when the profile has none, as the builder puts it there at the end of a build.players::seed_game_language(&p.ctx.profile, &options.language)?;L7 (should fix): The profile is seeded before the copied build is verified or committed.
When: If verification fails or the player cancels after seeding, the staged build is discarded but settings.ini retains the language choice, even though the installation did not complete.
Do: Seed the profile only after the copied build has passed verification and is ready to be committed, with appropriate handling if the final commit fails.
@ -0,0 +54,4 @@let Some(language) = code(language) else {return Ok(false);};with_edit_lock(profile, || {L6 (should fix): Seeding the profile does not check whether its game is running under the edit lock.
When: When a new installation reuses a game_language build for a profile whose running game has no game_language line, seed writes the line while that game is active. The game can subsequently save its older settings and remove the seeded choice.
Do: Check that the profile is idle under the edit lock before seeding, and leave its settings unchanged while the game is running.
Thanks. Both fixed in
a29d4fb.seednow asks the same running-game check aschooseandfollow_build(saves_idlefor the profile's folder), under the profile's edit lock. While a game plays the profile, its settings stay as they are and a log line says why.copy_candidate. That now only says whether the profile is to get the language;existingsets it only after the copy has been verified and moved into place, so a copy that fails or is cancelled leavessettings.inias it was.Tests:
reuse_testsnow covers a copy that fails verification (no line) and a game playing the profile (existing_withwith a failing check: the copy is made, no line).language::testscovers a seed refused while a game plays. fmt and clippy are clean, and the language tests pass on Windows.reuse_testsis Unix-only, so CI's Linux job is its first run.@review
Recommendation: Approve. The running-game and failed-copy cases are fixed. The complete update workflow still needs a run with a released game build that reads the profile setting. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge.
The launcher keeps a profile’s game language in its settings and uses it for builds and updates. The fix protects those settings while a game is running and seeds them only after a copied build is verified and installed.
Should fix (1): not blocking, but worth doing before merging.
src/game/reuse.rs:122: A failed language seed is logged but the copied build is still reported as successfully reused. (more on the line) Do: Propagate the seed failure or fall back to a build path that can establish the requested language before reporting success.Testing before merging (1) (the change behaves the same on every system: one run of the change itself is enough; it doesn't hold the recommendation)
@fixcan do L8.Since the last review (on
6696c2b107)Resolved: L6 (Seeding the profile does not check whether its game is running under the edit lock.); L7 (The profile is seeded before the copied build is verified or committed.)
Still open: L5 (The complete update workflow with a game that reads the profile setting has not been exerc…)
New: L8 (A failed language seed is logged but the copied build is still reported as successfully re…)
Checks: Still running: 5 checks.
More: does it help, other systems, switches, what was read
Does it help: Unproven end to end: the reported Windows test shows the profile setting is written and the companion game change reads it, but no complete launcher update with a released build that reads the setting has been exercised.
Other systems: The setting is shared with the game and builder. Older builds continue to use language.txt; the copied-build test covers the new and old record formats using Unix-only fixtures. An end-to-end update remains outstanding.
Switches: None.
Reviewed:
a29d4fbe95against21a83d2b44: Read the repository rules, the diff, src/players/language.rs, src/game/reuse.rs and src/game/wizard/reuse_tests.rs; inspected the related wizard, profile locking and running-game paths. Other changed files were reviewed through their diffs, not read in full.; nothing run (a code review).Checked and fine:
Testing: No commands that build or run project code were executed. The author reports Windows language tests and formatting and lint checks passing; CI is still running.
Overlaps and merge order: Longshot #2794 supplies the game and builder support and needs to land before the end-to-end update can be exercised.
Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.
@ -100,0 +119,4 @@players::seed_game_language(&p.ctx.profile, &options.language, || {idle(&p.ctx.profile)}){L8 (should fix): A failed language seed is logged but the copied build is still reported as successfully reused.
When: If another editor holds the profile lock long enough for seeding to fail, a new profile without game_language gets a copied build with no language.txt. The later follow_build call leaves the missing setting alone, so the game can start in its default language instead of the language requested in the wizard.
Do: Propagate the seed failure or fall back to a build path that can establish the requested language before reporting success.
Thanks. L8 is fixed in
6d22294. The copy of an existing build is now used only when the profile's language could be set for it. The language goes into the profile's settings once the copy is verified, right before it is moved into place. If that can't be done (a game playing the profile, the profile's lock held, or a write failing), the copy isn't used, and the normal build runs instead, which sets the language at its end as the builder does. If the copy then can't be moved into place,unseed_game_languageputs the profile's settings back to their text before.Tests:
language::testscovers seed refused while a game plays (an error, nothing written), seed then undo (no file, and a file of the game's own lines put back as it was).reuse_testsnow expects no copy while a game plays the profile (Unix-only; CI's Linux job runs it). fmt and clippy are clean, and the language tests pass on Windows.L5: still needs MagicBeanDev/Longshot#2794 in a nightly.
@review
Recommendation: Request changes. The reuse fix can overwrite or delete profile settings changed after seeding if the copied build cannot be moved into place. The end-to-end update with a released game that reads the profile setting also remains untested.
The launcher preserves a profile’s game language across updates and seeds it when reusing a compatible build. The latest fix falls back to a normal build when seeding fails, but its rollback can lose newer profile settings.
Blocking (1): must change before merging.
src/game/reuse.rs:300: Rollback restores a stale snapshot after releasing the profile edit lock, so it can discard settings written in the meantime. (more on the line) Do: Keep the profile edit lock across seeding, the rename and any rollback, so no other profile edit or game start can intervene.Testing before merging (1) (runs on the systems it can change; it doesn't hold the recommendation)
@fixcan do L9.Since the last review (on
a29d4fbe95)Resolved: L8 (A failed language seed is logged but the copied build is still reported as successfully re…)
Still open: L5 (The complete update workflow with a game that reads the profile setting has not been exerc…)
New: L9 (Rollback restores a stale snapshot after releasing the profile edit lock, so it can discar…)
Checks: they run again on this head; a failure shows on the pull request.
More: does it help, other systems, switches, what was read
Does it help: Unproven for the complete update workflow: the author demonstrated saving zh-Hans and starting the related game build in Chinese on Windows, but has not exercised an update using a released build that reads game_language.
Other systems: The setting is shared with the game and its builder; reuse and rollback touch the profile’s settings on both Windows and Linux. The reported game run was on Windows; the reuse tests are Unix-only.
Switches: None.
Reviewed:
6d2229497dagainst21a83d2b44: Read AGENTS.md and CONTRIBUTING.md, the changed reuse and language code, the latest fix diff, and the relevant wizard and locking paths. Skimmed the remaining pull-request diff, tests, UI changes and reported runs; not every changed code file was read in full. No review checklist or pull request template was found.; nothing run (a code review).Checked and fine:
Testing: No commands from the project or tests were run. The author reports Windows language tests, formatting and Clippy passing; CI has not run on this head.
Overlaps and merge order: MagicBeanDev/Longshot#2794 supplies the game and builder behavior; the described end-to-end update needs a nightly containing it.
Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.
@ -259,0 +297,4 @@};if let Err(error) = fs::rename(&staged, target) {if let players::Seeded::Put(before) = seeded&& let Err(undo) = players::unseed_game_language(&p.ctx.profile, before)L9 (blocking): Rollback restores a stale snapshot after releasing the profile edit lock, so it can discard settings written in the meantime.
When: After seed releases its lock, a game can start or the player can change the profile language. If the subsequent rename fails, unseed reacquires the lock and restores the earlier file or removes it, losing those newer settings.
Do: Keep the profile edit lock across seeding, the rename and any rollback, so no other profile edit or game start can intervene.
Thanks. L9 is fixed in
3b065e0. Setting the profile's language, moving the copy into place, and putting the settings back after a failed move now all run under one hold of the profile's edit lock. The builder'splaytakes that same lock before it starts the game, so no other profile edit and no game start can come in between.seedandunseedare now called with the lock already held. fmt and clippy are clean, and the language tests pass on Windows. L5: still needs MagicBeanDev/Longshot#2794 in a nightly.@review
Recommendation: Approve. The code is ready: only testing is left (a run of the change itself). The rollback now holds the profile edit lock through seeding, moving the copy, and any undo. The complete update workflow still needs a run with a released game build that reads the profile language. Recommend approval; not approved on the forge.
Keeps a profile’s game language in its settings and uses it when preparing builds. This addresses the reported reset, at the cost of coordinating settings writes with game launches and copied builds.
Testing before merging (1) (the change behaves the same on every system: one run of the change itself is enough; it doesn't hold the recommendation)
Since the last review (on
6d2229497d)Resolved: L9 (Rollback restores a stale snapshot after releasing the profile edit lock, so it can discar…)
Still open: L5 (The complete update workflow with a game that reads the profile setting has not been exerc…)
Checks: Still running: 5 checks.
More: does it help, other systems, switches, what was read
Does it help: Unproven end to end: the reported Windows run shows the profile setting being saved and a development game reading it, but an update to a released game build with game_language has not been exercised.
Other systems: The settings change affects builds and copied builds on Windows and Linux. The reported game and UI checks were on Windows; the copy tests are Unix-only and CI is still running.
Switches: None.
Reviewed:
3b065e02edagainst21a83d2b44: Read AGENTS.md, CONTRIBUTING.md, the full new src/players/language.rs, and the diffs for src/game/reuse.rs and src/players/language.rs. Searched callers and lock use; the other changed files and their full surrounding code were not read.; nothing run (a code review).Checked and fine:
Testing: No commands that run project code or tests were executed. The author reports Windows language tests passing; CI checks are still running.
Overlaps and merge order: Longshot#2794 supplies the game and builder behavior needed for the end-to-end update; it needs a nightly build for that run.
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.
Should be in settings tab
The Game language row moved from the Profiles page to Settings → Game, in
0ef2878. It's still the current profile's: it writes that profile'ssettings.inigame_language=through the same callback and checks as before, follows a profile switch, and is disabled with "Close the game first." while the game plays. No new texts. Checked by hand: choosing ja in the row wrotegame_language=jainto the profile'ssettings.ini.@review
Recommendation: Approve. The language choice and the moved Settings row have been exercised, but the complete update workflow still needs a run with a released game that reads the profile setting. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge.
The launcher saves a game language per profile and carries it through updates. The Settings row makes the choice available without a build; the change also adds coordination around profile writes and copied builds.
Should fix (1): not blocking, but worth doing before merging.
ui/settings.slint:71: A failed language change reports its error on the Profiles page, where it is not visible from this Settings row. (more on the line) Do: Display the profile-language callback's error beside the Settings row, and clear or replace it appropriately after a successful choice.Testing before merging (1) (the change behaves the same on every system: one run of the change itself is enough; it doesn't hold the recommendation)
@fixcan do L10.Since the last review (on
3b065e02ed)Still open: L5 (The complete update workflow with a game that reads the profile setting has not been exerc…)
New: L10 (A failed language change reports its error on the Profiles page, where it is not visible f…)
Checks: Still running:
CI / Rust formatting, lint and tests (pull_request),CI / Release packages and stable upgrades (pull_request).More: does it help, other systems, switches, what was read
Does it help: Unproven for the complete update workflow. The reported Windows test showed the old wizard selecting en-US for a zh-Hans build and the new game starting in Chinese from the profile setting, but did not exercise an update with a released game that reads it.
Other systems: The setting is shared with the game and builder. The profile edit lock and running-game check protect launcher writes; the complete integration with the new game and builder still needs an update run. Linux reuse tests are reported as awaiting CI.
Switches: None.
Reviewed:
0ef2878edaagainst21a83d2b44: Read the changed Settings row, Profiles page, dropdown, option row, profile language writer and callback, and repository rules. Skimmed the change summary, commit list and recorded runs; the rest of the changed code was not read in full on this check. The named review checklist and pull request template were absent.; nothing run (a code review).Checked and fine:
Testing: No commands that run project code or tests were executed. The author reports Windows hand testing and clean formatting and lint checks; CI was still running.
Overlaps and merge order: Longshot#2794 supplies the game and builder support needed for the complete update workflow.
Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.
@ -55,0 +68,4 @@model: Game.languages;current-value: root.value;selected(value) => {Players.profile-language(root.profile, value);L10 (should fix): A failed language change reports its error on the Profiles page, where it is not visible from this Settings row.
When: If another game process holds the profile or writing settings.ini fails, the callback sets Players.message and restores the displayed choice, but Settings → Game does not display that message, so the player cannot see why the change failed.
Do: Display the profile-language callback's error beside the Settings row, and clear or replace it appropriately after a successful choice.
Thanks. L10 is fixed in
9614ccd. A Game language choice that can't be saved now shows its reason under the row on Settings → Game (Players.language-message), and the next choice that is saved clears it. Checking it by hand also showed the row kept displaying a refused choice: the dropdown follows its selected index, not the text the handler put back. The row now follows the saved language's index (PlayerRow.game-language-index), so a refused choice snaps back.Checked by hand with the profile's
settings.inimade read-only: picking ru showed "Cannot save … Access is denied" under the row and the row went back to ja, with the file unchanged. Made writable again, ru saved (game_language=ru) and the message cleared. fmt and clippy are clean, and the language tests pass.@review
Recommendation: Approve. The code is ready: only testing is left (a run of the change itself). The language choice and its save errors are shown in Settings, and the reported failed-save case is fixed. The complete update workflow still needs a run with a released game build that reads the profile setting. Recommend approval; not approved on the forge.
The launcher preserves a profile’s game language across updates and lets players change it without rebuilding. The change adds coordination with profile locks and build reuse; its full update path remains unverified.
Testing before merging (1) (the change behaves the same on every system: one run of the change itself is enough; it doesn't hold the recommendation)
Since the last review (on
0ef2878eda)Resolved: L10 (A failed language change reports its error on the Profiles page, where it is not visible f…)
Still open: L5 (The complete update workflow with a game that reads the profile setting has not been exerc…)
Checks: Still running: 5 checks.
Also noticed (2; not asked for, not blocking)
More: does it help, other systems, switches, what was read
Does it help: Unproven: the author demonstrated the setting being saved and a development game build starting in Chinese, but has not tested a complete launcher update to a released build that reads game_language.
Other systems: The change affects profile settings, build reuse and update flows on Windows and Linux. The author reports Windows manual checks; the Unix-only reuse and wizard tests depend on the still-running Linux CI job.
Switches: No switches added, changed or removed.
Reviewed:
9614ccda9cagainst21a83d2b44: Read the repository rules, the change since the ledger head, the affected language and row code, and the relevant update and reuse diffs. Skimmed the remaining changed files and recorded test evidence; not every changed code file was read in full.; nothing run (a code review).Checked and fine:
Testing: No commands or tests were run. The author reports Windows manual checks, formatting and Clippy checks, and language tests; CI is still running.
Overlaps and merge order: Longshot#2794 supplies the game and builder support and needs to reach a nightly for the outstanding end-to-end update run.
Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.
Following up on L10 in
6d41d34: a choice that can't be saved now also says which language the row went back to. The message under the row starts "The game language stays ru: …" before the reason. It's a new text, translated in 12 catalogs; es-419 and fr-CA fall back to es and fr, and en-GB to English. Checked by hand with a read-onlysettings.ini(saved: ru; picked: pl): the row went back to ru and said "The game language stays ru: Cannot save … Access is denied", and the file was unchanged. fmt and clippy are clean;cargo testfails only on the same Windows folder tests as main.@HumanBean done: the Game language row is in the Settings tab now, under Settings → Game, its first row. I put it there because that section holds the game's own setup (your game copy, data and cache folders), while Settings → Launcher is for the launcher's own language and updates. It still sets the current profile's language, the same
game_language=line in that profile'ssettings.ini, so nothing about what the game reads changed. It follows a profile switch, is disabled with "Close the game first." while the game plays, and a choice that can't be saved goes back to the saved one and says so ("The game language stays …"). The Profiles page no longer has the row. Commits:0ef2878(the move),9614ccdand6d41d34(the error and snap-back). The branch is on current main.Before, on the Profiles page:
After, on Settings → Game:
In
a6b923fboth Game language dropdowns (Settings → Game and the update wizard) list each language by its own name, as the game's menu does (Español (Latinoamérica), 简体中文, 日本語), instead of codes likees-419orzh-Hans. Few players know those codes. The codes are still what's saved ingame_language=and passed to the builder. One sharedGameLanguageDropdown(ui/game-language.slint) takes and gives back the code and goes back to the saved one after a refused choice. "The game language stays …" names the language the same way. Checked by hand on Settings → Game.Already on main and not from this PR: on this Windows PC the first character of 简体中文 (简) draws as a box in every dropdown, the launcher's own Launcher language list included. The system's fallback font has Traditional characters but not that Simplified one. I'll raise that separately.
@review
Recommendation: Approve. The code is ready: only testing is left. The profile language setting and the language-name dropdowns have been exercised by hand, but the complete update workflow still needs a game build that reads the profile setting. That end-to-end run remains necessary before merge. Recommend approval; not approved on the forge.
The launcher keeps a game language with each profile, preserves it through builds and updates, and displays languages by their own names. The change adds coordination with the builder and profile edit lock in exchange for preserving the player's choice.
Testing before merging (1) (runs on the systems it can change; it doesn't hold the recommendation)
Since the last review (on
9614ccda9c)Still open: L5 (The complete update workflow with a game that reads the profile setting has not been exerc…)
Checks: Still running:
CI / Rust formatting, lint and tests (pull_request),CI / Release packages and stable upgrades (pull_request).More: does it help, other systems, switches, what was read
Does it help: Unproven for the complete update workflow: the author demonstrated the settings write and a game reading it on Windows, but has not exercised an update to a released build with game_language support.
Other systems: The settings affect the game and builder as well as the launcher; Longshot#2794 supplies the corresponding game and builder behavior. The recorded hand checks are on Windows; the reuse and wizard tests are Unix-only and their CI run is still pending.
Switches: No switches added, changed or removed.
Reviewed:
a6b923ff95against21a83d2b44: Read AGENTS.md, CONTRIBUTING.md, the changes since9614ccda9c, the profile language implementation, the dropdown implementation and the relevant builder, reuse and wizard diffs. Skimmed the translation additions and recorded runs; the remaining changed files were not read in full.; nothing run (a code review).Checked and fine:
Testing: No code or tests were run. The author reports Windows hand checks and passing formatting and lint checks; both CI jobs are still running.
Overlaps and merge order: Longshot#2794 supplies the game and builder support and needs to be available in a nightly for the outstanding update run.
Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.