fix(menu): the Save my pipeline list message is shown in the menu's language, and each language's count is its table's length #1318
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
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!1318
Loading…
Reference in a new issue
No description provided.
Delete branch "dukenheimer/Longshot:fix/menu-pt-br-count"
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?
Type: fix · Risk: low · Tested on: Windows 11, RTX 5090 (NVIDIA 621.14), in game (menu languages) and game-free checks; Linux (WSL Ubuntu 24.04, g++ 13; tools.lock's clang 23.1.5), the checks and a compile · Needs: none
Why
The help box's message after Save my pipeline list (Debug tab) is always in English, whatever the menu language.
It names the zip, how many pipelines it holds and where it went, then what to do next. The translation tables already
carry each piece of it (" pipelines) in ", "your home folder", "The report is in the zip. " ...), but
vk_menu.cppjoined the English pieces into one line first. The menu then looks the whole line up once, and no table has the whole
line, so every language shows it in English.
This started as the pt-BR count bug from the release check: #1103 added a text to all 13 tables without raising their
counts, so each language's last text, "your home folder", never loaded. #1277 already fixed those counts (thanks,
Phishinabowl): main's counts match their tables again. The in-game check of this branch then showed that loading
"your home folder" changes nothing on screen, because of the whole-line lookup above. So this PR fixes the message, and
takes the counts from the tables so they can't fall behind a third time.
Prior work: none found for the message (searched
share_saved,share_finish, "Save my pipeline list", "pipelinelist",
i18n::tr, "untranslated"; #1161 changes the pipeline list's contents, not its message, and touches neitherfunction). For the counts, #1277 above; #1257, #1246 and #1144 listed
test_menu_i18namong main's failures before it.How to reproduce
Seen on: Windows 11, RTX 5090 (NVIDIA 621.14), main
8e3dfde6; any OS and GPUSettings and switches: Menu language: any but English (e.g. Português (Brasil))
Steps: Insert menu, Debug tab, Save my pipeline list; read the help box. Game-free:
python -I -B tests/test_share_message_i18n.pyfrom this PR's test commitExpected: the message in the menu's language: "Salvo longshot-pipelines-....zip (N pipelines) na pasta Downloads. O relatório está no zip. Abra git.magicbean.dev/MagicBeanDev/Longshot/issues/14 e anexe o zip ..."
Actual: "Saved longshot-pipelines-....zip (N pipelines) in Downloads. The report is in the zip. Open git.magicbean.dev/MagicBeanDev/Longshot/issues/14 and attach the zip ...", in English, in every language
What changed
The pipeline-list message is now built from pieces that are each looked up in the menu's language as they go in, so it
shows translated in all 13 languages. Each language's count is now its table's length, so a new text can't be left
unloaded.
gpu/vk/vk_menu.cpp: four new functions build the message:share_folder_name,share_saved_line,share_done_lineandshare_not_written_line.share_pipeline_listandshare_finishcall them (refactor commit, English unchanged). The fix commit looks up each piece withi18n::tr. That includes share_downloads' words for the folder ("your home folder", "the game folder") and "Opening the issue...". The zip's name, its count and a folder's own name (Downloads) stay as they are. The log line stays in English and still never names the user's home folder.gpu/vk/menu_i18n.h: alang(code, name, table)helper takes the count from the table's size;kLangs' 13 translated rows use it.vk_menu_i18n.cpptable()is unchanged.tests/test_share_message_i18n.py(new) compiles the menu's lookup (vk_menu_i18n.cpp's tables,tr_text,tr) and the four message functions. It builds 210 lines (14 languages × 3 folders × 5 messages) and compares each with the tables' own pieces. It also checks that ui::para's whole-line lookup leaves the built line unchanged.tests/test_menu_i18n_count.py(new) compilesmenu_i18n.hand checks each count against its table.tests/test_menu_i18n.pyreads thelang()rows and fails on a count written by hand.Measurements
Verdict: fixed. The message check fails on 195 of 210 lines before the fix (every line in the 12 other languages comes out English; English's 15 pass) and passes all 210 here. The count check passes on main (#1277) and here; before #1277 it failed 13 of 13.
Hardware: Windows 11, RTX 5090 (NVIDIA 621.14), clang 23.1.5 (llvm-mingw, the Builder's), Python 3.14; WSL Ubuntu 24.04, g++ 13.3, Python 3.12
Scene: none for the numbers: game-free checks (the in-game run is under Testing)
Method:
python -I -B tests/test_share_message_i18n.py --cxx <compiler>on the test commit and on the fix;tests/test_menu_i18n_count.pyandtests/test_menu_i18n.pyon main and hereHow to reproduce: the commands above. The test commit is main plus the refactor and the check, without the fix
6d72ca93(with the check:2c1482e2)6c242520test_share_message_i18n.py, Windows clangtest_share_message_i18n.py, Linux g++test_menu_i18n_count.py8e9cfc3a)test_menu_i18n.pyFlags and settings
None: no menu row, switch or ini key is added or changed; only the text of a help message after Save my pipeline list.
Testing
Tested:
8e3dfde6(whose menu files are f88e6e3a's), its renderer built with dev_build.py vk, against main's built the same way. In the game, headless through the control bridge, the Insert menu in Português (Brasil) and Español (España): the same 85 rows (22 on Graphics), values and states on both; no errors in the logs. The menu's lookup (vk_menu_i18n.cpp tr_text, compiled from each side): "your home folder" English in all 13 languages on main, translated in all 13 here. Linux: tools.lock's clang 23.1.5 and sysroot compile gpu/vk/vk_menu_i18n.cpp with no warnings. That run was at 98fd6da3, the counts alone (the samemenu_i18n.has here), before the message fix.tests/test_share_message_i18n.pyboth ways, and against two broken fixes (table above), on Windows (clang 23.1.5) and Linux (WSL, g++ 13.3).gpu/vk/vk_menu.cppcompiled whole with-fsyntax-only -Wall -Wextra(clang 23.1.5, Windows, with the Builder's Vulkan, VMA and ImGui headers) on this PR and on main54ef5ca3(before #1302, which no compile here includes): the same 6 warnings on both, none on a changed line.python -I -B tests/run_all.py --changed(90 checks readvk_menu.cpp): 78 passed, 2 skipped (POSIX only). 10 failed, and the same 10 fail on a clean main54ef5ca3(rebased since onto6d72ca93, whose #1302 changes onlygpu/vk/switches.def):test_bug_report_defaults,test_crt_options,test_damage_debug_menu,test_framegen_preset,test_hud_layout_row,test_recorder_sync,test_rumble_menu,test_upscaler_round_trip,test_upscaler_rows,test_walk_key.python -I -B tests/run_all.pyis waiting for one of the PC's build slots (both held by long jobs); its result, against main's, follows as a comment. Before the message fix, the full suite on this branch's count change (Windows, on8e9cfc3a) failed only checks that fail on main too.Not tested: The translated message on screen: the control bridge can't press the Debug tab's tools, so the in-game run didn't show it. The check builds the same lines from the menu's own lookup and functions; the PC's runner will try a headless trigger later and comment with the pt-BR line if it works. A Linux build of the renderer as a whole (Linux compiled
vk_menu_i18n.cppwith tools.lock's clang, and the two checks with g++).Must be tested:
Risks
What could break: Only the help box's message after Save my pipeline list changes, in languages other than English. English is byte for byte as before (the check builds it). A translated message can be longer than the English. The help box's room is measured from
kShareSaidLongest, which the tables already translate whole, so it is measured in the menu's language. If the menu language changes while the message shows, it stays in the old language until the next save.Turning it off: revert the commits
Compatibility: Nothing changes for a player's files: no save, options file, cache or vk ABI change (
menu_i18n.hand these functions are internal tolongshot_vk;MkwVkHost/MkwVkRendererare untouched). The log line is unchanged. The user guide'ssettings-graphics.pngrecordsmenu_i18n.h,vk_menu.cppandvk_menu_i18n.cppas sources. It is the English Graphics tab, and the in-game check found its 22 rows unchanged, so the image is kept. Its source review already reports the shared sources changed on main; the manifest is left for the guide's next review.Checklist
Everyone
type(scope): description) of the status line's type.can't be run by hand is in Testing's Not testable by hand, with why.
in Risks.
main.python -I -B tests/run_all.pypasses (any failure that also fails onmainis named). The 90 checks that read the changed files (--changed): 10 fail, all failing on main too (named under Testing); the full run follows as a comment.third_party/untouched (a new folder with aPROVENANCE.mdinstead).When it applies
Assisted-by:/Co-Authored-By:trailers.mainand passing here.tests/that reads changed source updated in this PR, not weakened.The help box's line after a save was put together from English pieces, and ui::para looks the whole line up once, which no table has: in every language it showed in English, though menu_i18n.h's tables carry each piece (" pipelines) in ", "your home folder", "The report is in the zip. " ...). Each piece is now looked up as it goes in (share_folder_name, share_saved_line, share_done_line, share_not_written_line, and "Opening the issue..."). The zip's name, its count and a folder's own name stay as they are, and the log line stays English. Assisted-by: GitHub Copilot (Claude Opus 5.5) Co-authored-by: Copilot App <[email protected]>Tested in game: Windows 11, RTX 5090 (NVIDIA 621.14): this branch's menu_i18n.h on main
8e3dfde6(whose menu files are f88e6e3a's), its renderer built with dev_build.py vk, against main's built the same way. In the game, headless through the control bridge, the Insert menu in Português (Brasil) and Español (España): the same 85 rows (22 on Graphics), values and states on both; no errors in the logs. The menu's lookup (vk_menu_i18n.cpp tr_text, compiled from each side): "your home folder" English in all 13 languages on main, translated in all 13 here. Linux: tools.lock's clang 23.1.5 and sysroot compile gpu/vk/vk_menu_i18n.cpp with no warnings. Then, for the message fix added after that run (game-free, the menu's own lookup and message functions compiled): tests/test_share_message_i18n.py builds the Save my pipeline list message in all 14 languages, 210 lines, matching the tables' pieces; 195 of 210 English before the fix (Windows clang 23.1.5; Linux g++ 13.3 passes too).Full
python -I -B tests/run_all.py, Windows 11, clang 23.1.5 (llvm-mingw), 12 jobs,MAGICBEAN_TOOLINGset:6c242520: 624 passed, 46 failed, 52 skipped in 209 s (windows, 12 at once)6d72ca93, a clean checkout, the same run: 621 passed, 47 failed, 52 skipped in 189 s (windows, 12 at once)tests/test_longshot_ctl.pyEvery other failure fails on main alike on this PC.
Linux build check, for the "builds on both" box.
gpu/vk/vk_menu.cppandgpu/vk/vk_menu_i18n.cpp, at6c242520and at main6d72ca93, each compiled on its own with tools.lock's linux-x64 clang 23.1.5 and its sysroot (ubuntu22.04-gcc13-20261113), on WSL Ubuntu 24.04. Flags: nx2/build.py's renderer flags (and its Dear ImGui flags for vk_menu.cpp), plus-Wall -Wextra.vk_menu_i18n.cpp: compiles with no warnings, on both.vk_menu.cpp: compiles on both, with the same 6 warnings on both, so none is new from this PR. They are: deprecated arithmetic betweenDlssWhyandFsrWhy(2), a string-literal concatenation in an array, an unused parameter, and two unused functions. The build itself compiles with-Wno-everything.Not a run in the game: the message on screen still needs a windowed check.
The help box after Save my pipeline list is built from pieces the menu already translates, so it shows in the menu's language. I read head
6c242520. It applies onto current main.Each piece is looked up as it goes in: the saved line, the folder's words ("your home folder", "the game folder"), the report, the issue line, and the line when the zip could not be written. The zip's name, its count and a folder's own name stay as they are. The log stays in English and still does not name the home folder. Each language's count is the length of its table. The check compiles those functions with the menu's own lookup and compares 210 lines, 14 languages, with the tables' pieces. A lookup of the whole line leaves it as it was built. English is the same text as before. On Windows, an RTX 5090, the Insert menu in Portuguese and Spanish still has the same rows.
Nothing further has to be run before this merges.
Brought up to the ready-for-review standard (#1454): the checklist's Everyone list has two new boxes, added here from what this PR's description and comments show (please check they match what you know).
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.