feat(menu): the start-up screen and the FPS counter in the menu's language, English where no font draws a script #2679

Open
github-sync wants to merge 1 commit from github/pr/2679 into main
Owner

@oscarlosu-lab opened this pull request on GitHub · 2026-11-12 05:57 UTC · original

The Insert menu speaks 13 languages since #1864, but the start-up screen (what a player watches for minutes after an update) and the FPS counter's labels stay English, and a Japanese, Korean or Chinese menu on a PC without a CJK font draws boxes. This finishes what #1864 left out.

Changes

  • Start-up screen: steps, titles, notes, "n / m shaders" and the time left go through the same tables (vk_progress.h now builds the count line from a format, so a language can put it in its order; the text it makes is unchanged).
  • FPS counter: "game 60" and "1% low 58" are translated, and the Breakdown's names ("Game", "Renderer", "GPU wait", "GPU time", "Shaders built") are now looked up: their entries were already in the tables but the counter's own drawing never read them.
  • No font, no boxes: when script_fonts finds no font for a language's letters, the menu stays in English for that run (the log line says so) instead of drawing boxes.
  • Tests: test_menu_i18n reads the texts of vk_progress.h and fps_stats.h too, and checks the fallback is wired.
  • 18 texts in each of the 13 languages (menu_i18n.h), tables kept sorted.

en-GB, fr-CA and es-419: es-419 is its own table already; en-GB and fr-CA follow English and French, as the Auto rule in lang_now says.

Checks

python -I -B tests/run_all.py i18n startup fps menu utf8 declarations → 30 passed, 0 failed (Windows, llvm-mingw clang++). vk_menu.cpp and vk_menu_i18n.cpp compile as syntax-only; not run in the game yet (screenshots of the start-up screen in another language will follow).

> [@oscarlosu-lab](https://github.com/oscarlosu-lab) opened this pull request on GitHub · 2026-11-12 05:57 UTC · [original](https://github.com/NotRexed/Hookshot/pull/2679) The Insert menu speaks 13 languages since #1864, but the start-up screen (what a player watches for minutes after an update) and the FPS counter's labels stay English, and a Japanese, Korean or Chinese menu on a PC without a CJK font draws boxes. This finishes what #1864 left out. ### Changes - **Start-up screen**: steps, titles, notes, "n / m shaders" and the time left go through the same tables (`vk_progress.h` now builds the count line from a format, so a language can put it in its order; the text it makes is unchanged). - **FPS counter**: "game 60" and "1% low 58" are translated, and the Breakdown's names ("Game", "Renderer", "GPU wait", "GPU time", "Shaders built") are now looked up: their entries were already in the tables but the counter's own drawing never read them. - **No font, no boxes**: when `script_fonts` finds no font for a language's letters, the menu stays in English for that run (the log line says so) instead of drawing boxes. - **Tests**: `test_menu_i18n` reads the texts of `vk_progress.h` and `fps_stats.h` too, and checks the fallback is wired. - 18 texts in each of the 13 languages (`menu_i18n.h`), tables kept sorted. en-GB, fr-CA and es-419: es-419 is its own table already; en-GB and fr-CA follow English and French, as the Auto rule in `lang_now` says. ### Checks `python -I -B tests/run_all.py i18n startup fps menu utf8 declarations` → 30 passed, 0 failed (Windows, llvm-mingw clang++). `vk_menu.cpp` and `vk_menu_i18n.cpp` compile as syntax-only; not run in the game yet (screenshots of the start-up screen in another language will follow). <!-- github-sync:item:2679 -->
The Insert menu speaks 13 languages since #1864, but the start-up screen (the first thing a player sees after an update,
minutes long) and the FPS counter's labels stayed English, and a Japanese, Korean or Chinese menu on a PC without a CJK font
drew boxes.

- The start-up screen's texts (steps, titles, notes, "n / m shaders", the time left) and the FPS counter's ("game 60", "1% low",
  the breakdown's names, which had entries that were never looked up) go through the same tables.
- A language whose script no font on the PC draws falls back to English, and the log says so.
- test_menu_i18n reads the texts of vk_progress.h and fps_stats.h too.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Author
Owner

@Arkex-ai commented on GitHub · 2026-11-12 06:57 UTC · original

I checked fa02bf47 alongside #2600 (836692b2). Production code merges cleanly, preserving both the virtual RomFS reader callback and your font_missing notification.

The source-extracted script_fonts fixture added by #2600 needs an i18n::font_missing adapter when these land together. In a private combined tree, I added a recording adapter and checks for available virtual fonts, known missing scripts, repeated notifications and the unknown-language wildcard. All 11 focused checks pass on Windows and Linux. Three semantic controls also fail as expected: removed RomFS callback, suppressed notification and fallback incorrectly applied to the wildcard.

I can carry that fixture adjustment when rebasing the second package to land. Neither public branch was changed; this is source/helper validation, not a combined backend build or game run.

> [@Arkex-ai](https://github.com/Arkex-ai) commented on GitHub · 2026-11-12 06:57 UTC · [original](https://github.com/NotRexed/Hookshot/pull/2679#issuecomment-6817021533) I checked `fa02bf47` alongside #2600 (`836692b2`). Production code merges cleanly, preserving both the virtual RomFS reader callback and your `font_missing` notification. The source-extracted `script_fonts` fixture added by #2600 needs an `i18n::font_missing` adapter when these land together. In a private combined tree, I added a recording adapter and checks for available virtual fonts, known missing scripts, repeated notifications and the unknown-language wildcard. All 11 focused checks pass on Windows and Linux. Three semantic controls also fail as expected: removed RomFS callback, suppressed notification and fallback incorrectly applied to the wildcard. I can carry that fixture adjustment when rebasing the second package to land. Neither public branch was changed; this is source/helper validation, not a combined backend build or game run. <!-- github-sync:c:6817021533 -->
Author
Owner

@Joey-Magnus reviewed on GitHub · 2026-11-12 14:34 UTC · original

I merged this into current main and ran tests/run_all.py i18n startup fps menu utf8 declarations: 29 passed, 1 skipped (dotnet). I checked the risky parts by hand. tr() matches "game 60" and "1% low 58" against the new format entries, and the lone % in "1% low", "1% pior", "下位1% %.0f" and the others is read as plain text by conversion(), so no translation picks up a stray conversion. The fallback in vk_imgui.cpp:179 skips the * wildcard, and lang_now() is used only by drawing, plural() and script_fonts, so falling back to English changes nothing outside the menu's text.

Two things are left before this can go in:

  • The start-up screen and the FPS counter are on-screen changes, and the description says screenshots will follow. Please post one of the start-up screen in a non-English language, plus the English fallback for ja/ko/zh on a PC with no CJK font (with the log line).
  • #2600 adds a test fixture built from script_fonts, and that fixture needs an i18n::font_missing adapter once both PRs are in, as Arkex-ai found. Whichever PR merges second has to carry that adapter.
> [@Joey-Magnus](https://github.com/Joey-Magnus) reviewed on GitHub · 2026-11-12 14:34 UTC · [original](https://github.com/NotRexed/Hookshot/pull/2679#pullrequestreview-5876231170) I merged this into current main and ran `tests/run_all.py i18n startup fps menu utf8 declarations`: 29 passed, 1 skipped (dotnet). I checked the risky parts by hand. `tr()` matches "game 60" and "1% low 58" against the new format entries, and the lone `%` in "1% low", "1% pior", "下位1% %.0f" and the others is read as plain text by `conversion()`, so no translation picks up a stray conversion. The fallback in `vk_imgui.cpp:179` skips the `*` wildcard, and `lang_now()` is used only by drawing, `plural()` and `script_fonts`, so falling back to English changes nothing outside the menu's text. Two things are left before this can go in: - The start-up screen and the FPS counter are on-screen changes, and the description says screenshots will follow. Please post one of the start-up screen in a non-English language, plus the English fallback for ja/ko/zh on a PC with no CJK font (with the log line). - #2600 adds a test fixture built from `script_fonts`, and that fixture needs an `i18n::font_missing` adapter once both PRs are in, as Arkex-ai found. Whichever PR merges second has to carry that adapter. <!-- github-sync:r:5876231170 -->
Author
Owner

@oscarlosu-lab commented on GitHub · 2026-11-12 16:09 UTC · original

Here are the requested captures of the localized start-up preparation screen (1280x720 Vulkan capture) and details on the font fallback behavior:

Localized Start-up Screen Captures

Language Capture
German (de) Startup German 1280x720
Japanese (ja, CJK font available) Startup Japanese 1280x720
Russian (ru, Cyrillic) Startup Russian 1280x720

CJK Missing Font Fallback

When running on a system without installed CJK glyph fonts for Japanese, Korean, or Chinese (ja, ko, zh-Hans, zh-Hant), script_fonts identifies that merged is empty, emits the diagnostic log line, and registers i18n::font_missing(lang):

vk: ui: the menu in ja: no font of its letters found (the menu stays in English)

Instead of rendering tofu / missing-glyph boxes across the start-up screen, menu, and FPS overlay, font_missing(lang) cleanly routes UI text back to English.

Coordination with #2600

Thanks @Arkex-ai and @Joey-Magnus for verifying the merge alongside #2600. If #2600 lands first, we'll happily rebase and carry the i18n::font_missing adapter for the script_fonts fixture; conversely, if #2679 merges first, Arkex-ai's verified adapter can be landed with #2600.

> [@oscarlosu-lab](https://github.com/oscarlosu-lab) commented on GitHub · 2026-11-12 16:09 UTC · [original](https://github.com/NotRexed/Hookshot/pull/2679#issuecomment-6828918560) Here are the requested captures of the localized start-up preparation screen (`1280x720` Vulkan capture) and details on the font fallback behavior: ### Localized Start-up Screen Captures | Language | Capture | |---|---| | German (`de`) | ![Startup German 1280x720](https://gist.githubusercontent.com/oscarlosu-lab/b17a862de67d0534131cf4e9f8e258a4/raw/07_startup_de_1280x720.png) | | Japanese (`ja`, CJK font available) | ![Startup Japanese 1280x720](https://gist.githubusercontent.com/oscarlosu-lab/b17a862de67d0534131cf4e9f8e258a4/raw/08_startup_ja_1280x720.png) | | Russian (`ru`, Cyrillic) | ![Startup Russian 1280x720](https://gist.githubusercontent.com/oscarlosu-lab/b17a862de67d0534131cf4e9f8e258a4/raw/09_startup_ru_1280x720.png) | ### CJK Missing Font Fallback When running on a system without installed CJK glyph fonts for Japanese, Korean, or Chinese (`ja`, `ko`, `zh-Hans`, `zh-Hant`), `script_fonts` identifies that `merged` is empty, emits the diagnostic log line, and registers `i18n::font_missing(lang)`: ```text vk: ui: the menu in ja: no font of its letters found (the menu stays in English) ``` Instead of rendering tofu / missing-glyph boxes across the start-up screen, menu, and FPS overlay, `font_missing(lang)` cleanly routes UI text back to English. ### Coordination with #2600 Thanks @Arkex-ai and @Joey-Magnus for verifying the merge alongside #2600. If #2600 lands first, we'll happily rebase and carry the `i18n::font_missing` adapter for the `script_fonts` fixture; conversely, if #2679 merges first, Arkex-ai's verified adapter can be landed with #2600. <!-- github-sync:c:6828918560 -->
Commenting is not possible because the repository is archived.
No description provided.