The in-game menu and the overlay speak German, French, Spanish, Italian, Dutch, Japanese and Korean, every one of the 670 menu texts, picked from the Windows display language or the Menu tab, with every Chinese Windows on the Simplified Chinese menu (the menu part of pull request #497, completed for today's menu)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
itaskaev2andClaude Opus 5.5 committed 2026-11-22 17:11:26 +01:00
1 parent 7f17cad783
commit 37d49d80d2
8 files changed
+6073 -42

No files matched your search

+10 -9
View File
@@ -28,7 +28,7 @@ Report problems as issues, following [CONTRIBUTING.md](CONTRIBUTING.md).
- In-game settings menu (F1) and performance overlay (F10)
- Play time across runs on the Game tab of the settings menu, kept in `playtime.txt` next to the saves
- Discord Rich Presence ("Playing TotK Recomp" with the play time), off by default, own application id supported
- Setup in 11 languages, in-game menu in 4 ([Languages](#languages))
- Setup in 12 languages, in-game menu in 11 ([Languages](#languages))
- Keyboard, mouse and gamepad with remapping, rumble and gyro
- Stereo or 5.1 surround sound output
- Xbox and PlayStation button prompts: Xbox's LB, RB, LT, RT, Menu, View and A, B, X, Y, or PlayStation's ○ × △ □, L1, R1, L2, R2, Options and Share, as labelled on the button to press, with either button layout
@@ -43,7 +43,7 @@ Report problems as issues, following [CONTRIBUTING.md](CONTRIBUTING.md).
The game keeps the text and voices of every language it shipped with. The port's own setup and in-game menu (F1) come
in these; both follow the Windows display language, and the menu has its own choice on its Menu tab. A Traditional
Chinese Windows gets the Simplified Chinese setup.
Chinese Windows gets the Simplified Chinese setup and menu.
| Language | Setup | In-game menu |
|---|:---:|:---:|
@@ -51,13 +51,14 @@ Chinese Windows gets the Simplified Chinese setup.
| Русский | ✅ | ✅ |
| Português (Brasil) | ✅ | ✅ |
| 简体中文 | ✅ | ✅ |
| Deutsch | ✅ | English |
| Français | ✅ | English |
| Español | ✅ | English |
| Italiano | ✅ | English |
| Nederlands | ✅ | English |
| 日本語 | ✅ | English |
| 한국어 | ✅ | English |
| Deutsch | ✅ | ✅ |
| Français | ✅ | ✅ |
| Español | ✅ | ✅ |
| Italiano | ✅ | ✅ |
| Nederlands | ✅ | ✅ |
| 日本語 | ✅ | ✅ |
| 한국어 | ✅ | ✅ |
| Tiếng Việt | ✅ | English |
Spotted a clumsy phrase, or want your language added? The setup texts are in `installer/text/<language>.json`, the
menu texts in `runtime/ui_text.c`; open an issue or a pull request ([CONTRIBUTING.md](CONTRIBUTING.md)). Fixes from
+2 -2
View File
@@ -59,8 +59,8 @@ MacNativeGames cannot run on x86-64 as is: its CPU path executes ARM64 code nati
- Settings and menu: every key with its default is in one table (`cfg.c`), read from `totk.ini` and `TOTK_*`
variables and written back when the in-game menu changes it. The menu and the performance overlay are Dear ImGui,
drawn into the swapchain image (`runtime/ui/`); their text is in `ui_text.c` (English, Russian, Brazilian Portuguese,
Simplified Chinese). The Chinese glyphs come from a system font (Microsoft YaHei, `plat_font_path`) merged into the
font atlas.
Simplified Chinese, German, French, Spanish, Italian, Dutch, Japanese, Korean). The Chinese, Japanese and Korean glyphs
come from a system font (`plat_font_path`) merged into the font atlas.
- OS calls the host makes go through `runtime/platform/` (`platform.h`, `win32.c`), so a Linux or macOS host adds one file instead of touching the rest. The split is not finished: `tools/check_platform.py` lists the Win32 uses left in the other files.
#### Threads and cores
+1 -1
View File
@@ -204,7 +204,7 @@ static const CfgMeta metas[] = {
{"GAMEPLAY_MAP_ZOOM_SENSITIVITY", "1", "0.25..4", LIVE}, {"GAMEPLAY_ROTATION_SENSITIVITY", "1", "0.25..4", LIVE},
{"GAMEPLAY_DISTANCE_SENSITIVITY", "1", "0.25..4", LIVE}, {"GAMEPLAY_ITEM_SENSITIVITY", "1", "0.25..4", LIVE},
{"GAMEPLAY_WEAPON_WHEEL", "1", "0|1", LIVE}, {"GAMEPLAY_WEAPON_SENSITIVITY", "1", "0.25..4", LIVE},
{"MENU_LANG", "", "en|ru|pt-BR|zh-Hans", LIVE},
{"MENU_LANG", "", "en|ru|pt-BR|zh-Hans|de|fr|es|it|nl|ja|ko", LIVE},
// plat_font_path on Linux: 1 asks fontconfig which file draws the language, 0 keeps the fixed distribution
// paths. A rebuild of the atlas reads it, so a change shows on the next window size or language switch.
{"MENU_FONT_FONTCONFIG", "1", "0|1", LIVE},
+27 -6
View File
@@ -1013,10 +1013,12 @@ static void probe_fonts(void) {
}
// The host catalog (ui_text.c): every menu id has its own English, Russian, Brazilian Portuguese and Simplified
// Chinese text, the software keyboard keeps its game-language rows, and menu_text follows TOTK_MENU_LANG.
// Chinese text, every menu language's text fits the description pane and keeps the English conversions of the overlay
// formats, the software keyboard keeps its game-language rows, and menu_text follows TOTK_MENU_LANG.
static void probe_menu_text(void) {
static const char *const langs[] = {"en", "ja", "fr", "de", "it", "es", "nl", "pt", "ru", "zh-Hans", "zh-Hant", "ko",
"pt-BR"};
static const char *const menu_langs[] = {"de", "fr", "es", "it", "nl", "ja", "ko"};
for (int id = UI_MENU_FIRST; id <= UI_MENU_LAST_ID; id++) {
CHECK(ui_text_defined("en", (UiTextId)id) && ui_text_defined("ru", (UiTextId)id) &&
ui_text_defined("pt-BR", (UiTextId)id), "menu text id %d lacks en, ru or pt-BR", id);
@@ -1028,11 +1030,21 @@ static void probe_menu_text(void) {
strlen(ui_text_in("pt-BR", (UiTextId)id)) + 256 < UI_DESC_BYTES &&
strlen(ui_text_in("zh-Hans", (UiTextId)id)) + 256 < UI_DESC_BYTES,
"menu text id %d is too long for the description pane", id);
for (size_t i = 0; i < sizeof menu_langs / sizeof *menu_langs; i++)
CHECK(strlen(ui_text_in(menu_langs[i], (UiTextId)id)) + 256 < UI_DESC_BYTES,
"menu text id %d is too long for the description pane in %s", id, menu_langs[i]);
CHECK(ui_text_defined("zh-Hans", (UiTextId)id), "menu text id %d lacks Simplified Chinese", id);
}
CHECK(!ui_text_defined("en", UI_TEXT_COUNT) && !*ui_text_in("ru", UI_TEXT_COUNT), "an id past the catalog gives text");
// other languages fall back to English for the menu, and keep their own keyboard texts
CHECK(!strcmp(ui_text_in("ja", UI_MENU_CONTINUE), ui_text_in("en", UI_MENU_CONTINUE)), "ja menu text is not English");
// the other game languages have their own menu text; Traditional Chinese falls back to English in the catalog
for (size_t i = 0; i < sizeof menu_langs / sizeof *menu_langs; i++) {
CHECK(ui_text_defined(menu_langs[i], UI_MENU_TITLE) && ui_text_defined(menu_langs[i], UI_MENU_CONTINUE),
"%s has no menu text", menu_langs[i]);
CHECK(strstr(ui_text_in(menu_langs[i], UI_MENU_OV_GAME_PCT), "%.0f%%"), "%s overlay format lost its conversion",
menu_langs[i]);
}
CHECK(!strcmp(ui_text_in("zh-Hant", UI_MENU_CONTINUE), ui_text_in("en", UI_MENU_CONTINUE)),
"zh-Hant menu text is not English");
CHECK(!strcmp(ui_text_in("ru", UI_SWKBD_OK), "ОК") && !strcmp(ui_text_in("de", UI_SWKBD_CANCEL), "Abbrechen") &&
!strcmp(ui_text_in("en", UI_SWKBD_OK), "OK"), "keyboard texts changed");
// language names: the same string in every row
@@ -1075,15 +1087,24 @@ static void probe_menu_text(void) {
CHECK(menu_text(UI_MENU_CONTINUE) == ui_text_in("en", UI_MENU_CONTINUE), "menu_text did not follow MENU_LANG=en");
cfg_set("TOTK_MENU_LANG", "zh-Hans");
CHECK(menu_text(UI_MENU_TITLE) == ui_text_in("zh-Hans", UI_MENU_TITLE), "menu_text ignores MENU_LANG=zh-Hans");
cfg_set("TOTK_MENU_LANG", "ja");
CHECK(menu_text(UI_MENU_TITLE) == ui_text_in("ja", UI_MENU_TITLE), "menu_text ignores MENU_LANG=ja");
cfg_set("TOTK_MENU_LANG", "de-DE");
CHECK(menu_text(UI_MENU_TITLE) == ui_text_in("de", UI_MENU_TITLE), "menu_text ignores MENU_LANG=de-DE");
// Traditional Chinese (zh-TW, zh-HK) reads the Simplified Chinese menu
cfg_set("TOTK_MENU_LANG", "zh-TW");
CHECK(menu_text(UI_MENU_TITLE) == ui_text_in("zh-Hans", UI_MENU_TITLE), "zh-TW does not get the zh-Hans menu");
cfg_set("TOTK_MENU_LANG", "");
// the system language as ui_text.c resolve_menu_lang takes it: the tag, else its base language (ru-RU: ru), else en
// the system language as ui_text.c resolve_menu_lang takes it: the tag, else its base language (ru-RU: ru), else
// Simplified Chinese for any Chinese, else en
const char *sys_lang = ui_text_lang(plat_ui_language());
char sys_base[16] = "";
size_t base_n = strcspn(sys_lang, "-");
if (sys_lang[base_n] && base_n < sizeof sys_base) memcpy(sys_base, sys_lang, base_n);
const char *auto_lang = ui_text_defined(sys_lang, UI_MENU_TITLE) ? sys_lang
const char *auto_lang = ui_text_defined(sys_lang, UI_MENU_TITLE) ? sys_lang
: *sys_base && ui_text_defined(sys_base, UI_MENU_TITLE) ? sys_base
: "en";
: !strncmp(sys_lang, "zh", 2) ? "zh-Hans"
: "en";
CHECK(menu_text(UI_MENU_CONTINUE) == ui_text_in(auto_lang, UI_MENU_CONTINUE), "menu_text auto ignores the system language");
}
+10 -7
View File
@@ -276,12 +276,13 @@ static int vk_up(const MenuTarget *t) {
return 1;
}
// Roboto Medium (Latin, Cyrillic, dashes and quotes) at 26 px per 1080 lines, with the glyphs of the Japanese, Korean
// and Chinese language names merged in from a system font when there is one (each language is named in its own script).
// A catalog row also holds menu text (Simplified Chinese), so every string of the row goes into the builder: the merged
// font must cover the whole menu of that language, not only its name. Made again when the window height changes; the old
// texture goes after the queue is idle (CreateFontsTexture).
static const ImWchar kRanges[] = {0x0020, 0x00FF, 0x0400, 0x052F, 0x2010, 0x2027, 0};
// Roboto Medium (Latin with Latin Extended-A for the French oe, Cyrillic, dashes and quotes) at 26 px per 1080 lines,
// with the glyphs of the Japanese, Korean and Chinese language names merged in from a system font when there is one
// (each language is named in its own script). A catalog row also holds menu text (Japanese, Korean, Simplified
// Chinese), so every string of the row goes into the builder: the merged font must cover the whole menu of that
// language, not only its name. Made again when the window height changes; the old texture goes after the queue is idle
// (CreateFontsTexture).
static const ImWchar kRanges[] = {0x0020, 0x017F, 0x0400, 0x052F, 0x2010, 0x2027, 0};
static const struct { const char *lang; UiTextId name; } kCjk[] = {
{"ja", UI_MENU_LANGNAME_JA}, {"ko", UI_MENU_LANGNAME_KO}, {"zh-Hans", UI_MENU_LANGNAME_ZH_HANS},
{"zh-Hant", UI_MENU_LANGNAME_ZH_HANT},
@@ -1179,7 +1180,9 @@ static void tab_controls(float scale) {
static void tab_menu(float scale) {
opt_begin("##menu", scale);
static const UiTextId langs[] = {UI_MENU_MENU_LANG_AUTO, UI_MENU_LANGNAME_EN, UI_MENU_LANGNAME_RU,
UI_MENU_LANGNAME_PT_BR, UI_MENU_LANGNAME_ZH_HANS};
UI_MENU_LANGNAME_PT_BR, UI_MENU_LANGNAME_ZH_HANS, UI_MENU_LANGNAME_DE,
UI_MENU_LANGNAME_FR, UI_MENU_LANGNAME_ES, UI_MENU_LANGNAME_IT,
UI_MENU_LANGNAME_NL, UI_MENU_LANGNAME_JA, UI_MENU_LANGNAME_KO};
opt_choice("TOTK_MENU_LANG", UI_MENU_MENU_LANG, langs, sizeof langs / sizeof *langs, UI_MENU_MENU_LANG_DESC);
opt_toggle("TOTK_DISCORD_RPC", UI_MENU_DISCORD_RPC, UI_MENU_DISCORD_RPC_DESC);
opt_end();
+6016 -10
View File
File diff suppressed because it is too large. Load diff
+5 -5
View File
@@ -11,8 +11,8 @@ typedef enum {
UI_SWKBD_CANCEL,
UI_SWKBD_PAD_HINT, // how a controller answers
// Menu: window, tabs, bottom row. UI_MENU_FIRST..UI_MENU_LAST_ID carry English, Russian, Brazilian Portuguese and
// Simplified Chinese texts.
// Menu: window, tabs, bottom row. UI_MENU_FIRST..UI_MENU_LAST_ID carry English, Russian, Brazilian Portuguese,
// Simplified Chinese, German, French, Spanish, Italian, Dutch, Japanese and Korean texts.
UI_MENU_FIRST,
UI_MENU_TITLE = UI_MENU_FIRST,
UI_MENU_TAB_SCREEN, UI_MENU_TAB_GAME, UI_MENU_TAB_MODS, UI_MENU_TAB_SOUND, UI_MENU_TAB_CONTROLS, UI_MENU_TAB_AMIIBO,
@@ -331,7 +331,7 @@ const char *ui_text_lang(const char *switch_code);
typedef struct { const char *code; UiTextId name; } UiGameLang;
int ui_text_game_langs(int game_version, UiGameLang *out, int max);
// Menu text: ui_text_in(menu language, id). The menu language is TOTK_MENU_LANG ("en", "ru", "pt-BR", "zh-Hans");
// unset, the system UI language when the catalog has menu text for it (English, Russian, Brazilian Portuguese,
// Simplified Chinese), else English. Follows a live change of the setting.
// Menu text: ui_text_in(menu language, id). The menu language is TOTK_MENU_LANG ("en", "ru", "pt-BR", "zh-Hans", "de",
// "fr", "es", "it", "nl", "ja", "ko"); unset, the system UI language when the catalog has menu text for it, Simplified
// Chinese for Traditional Chinese, else English. Follows a live change of the setting.
const char *menu_text(UiTextId id);
+2 -2
View File
@@ -367,8 +367,8 @@
# lang = en-US
# System mode reported to the game: docked or handheld.
# operation_mode = docked
# Language of the settings menu and the overlay: en, ru, pt-BR or zh-Hans. Default: the Windows display language, English if
# it is none of them.
# Language of the settings menu and the overlay: en, ru, pt-BR, zh-Hans, de, fr, es, it, nl, ja or ko. Default: the Windows
# display language (Simplified Chinese for any Chinese), English if it is none of them.
# menu_lang = en
[discord]