Skip to content

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

Open
oscarlosu-lab wants to merge 1 commit into
NotRexed:mainfrom
oscarlosu-lab:feat/menu-i18n-startup-fps
Open

oscarlosu-lab wants to merge 1 commit into
NotRexed:mainfrom
oscarlosu-lab:feat/menu-i18n-startup-fps

Conversation

@oscarlosu-lab

@oscarlosu-lab oscarlosu-lab commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

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).

…guage, English where no font draws a script

The Insert menu speaks 13 languages since NotRexed#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 <noreply@anthropic.com>
@Arkex-ai

Copy link
Copy Markdown
Contributor

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.

@Joey-Magnus Joey-Magnus left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@oscarlosu-lab

Copy link
Copy Markdown
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants