Add more languages #1566

Closed
opened 2026-11-10 08:36:01 +00:00 by wwwjiaoyuan · 4 comments
wwwjiaoyuan commented 2026-11-10 08:36:01 +00:00 (Migrated from github.com)

The idea

please!!!please!!!please!!!please!!!

Anything else

No response

### The idea please!!!please!!!please!!!please!!! ### Anything else _No response_
NotRexed commented 2026-11-10 08:47:38 +00:00 (Migrated from github.com)

Thanks! Could you say which you mean? The game's own languages (text and voices) come from your copy of the game, so Hookshot can only offer the ones it contains (the language is chosen with language.txt beside the game). If you mean the Insert menu (Hookshot's own settings menu), that is in English for now; translations of it are a possible addition (tracked with other ideas in #1007). Leaving this open for your answer.

Thanks! Could you say which you mean? The game's own languages (text and voices) come from your copy of the game, so Hookshot can only offer the ones it contains (the language is chosen with `language.txt` beside the game). If you mean the Insert menu (Hookshot's own settings menu), that is in English for now; translations of it are a possible addition (tracked with other ideas in #1007). Leaving this open for your answer.
MorpheusCode117 commented 2026-11-10 09:07:15 +00:00 (Migrated from github.com)

Thanks! Could you say which you mean? The game's own languages (text and voices) come from your copy of the game, so Hookshot can only offer the ones it contains (the language is chosen with language.txt beside the game). If you mean the Insert menu (Hookshot's own settings menu), that is in English for now; translations of it are a possible addition (tracked with other ideas in #1007). Leaving this open for your answer.

When you select Japanese, it's english voices. I don't know if it's coming from the emulator or the version of the game. I know the switch 2 is zoned, not like the switch 1. But then I think the global version wouldn't propose Japanese if it's not working. I will have a look and see if it comes from the version of the game.

> Thanks! Could you say which you mean? The game's own languages (text and voices) come from your copy of the game, so Hookshot can only offer the ones it contains (the language is chosen with `language.txt` beside the game). If you mean the Insert menu (Hookshot's own settings menu), that is in English for now; translations of it are a possible addition (tracked with other ideas in [#1007](https://git.magicbean.dev/MagicBeanDev/Hookshot/issues/1007)). Leaving this open for your answer. When you select Japanese, it's english voices. I don't know if it's coming from the emulator or the version of the game. I know the switch 2 is zoned, not like the switch 1. But then I think the global version wouldn't propose Japanese if it's not working. I will have a look and see if it comes from the version of the game.
l85162262-lab commented 2026-11-10 10:47:09 +00:00 (Migrated from github.com)

Adding the Insert-menu detail you asked for above, since that is the menu I mean (Insert / F1 / controller Home).

I went through the v2.0.11 source archive, so here is exactly what the Insert menu needs, in case it helps to scope the work.

Where the text lives

  • gpu/vk/vk_menu.cpp: the rows[] table (26 rows, each a label plus a long help paragraph), the tx_*() value formatters ("Off" / "On" / "Custom" / "16:9 (restart)" / "Balanced (8GB)" ...), the tab names, the bottom hint lines, teleport_names[] (31 map names) and pouch_items[]. Roughly 380 string literals and 30 TextOutA() call sites.
  • gpu/vk/oot_cheat_items.h: the inventory editor's item names.

Why it is more than swapping the strings

The menu is painted with Win32 GDI, not with the game's font:

  • font() is CreateFontA(-px, ..., DEFAULT_CHARSET, ..., "Segoe UI"), a Latin-only face;
  • every draw goes through TextOutA / GetTextExtentPoint32A, the ANSI single-byte path, while the literals in the source are UTF-8, so a Chinese literal arrives as mojibake;
  • widths, the right-aligned value column and truncation are computed from std::string::size(), i.e. bytes: marquee_pos() slides a label by bytes, the not-selected case cuts it with "..." by bytes, and wrap_help() breaks lines at spaces. Chinese has no spaces and double-width glyphs, so a translated help paragraph runs off the panel and labels get cut mid-character.

So a localization patch has to touch the face (Microsoft YaHei / Noto Sans CJK, or the W APIs with UTF-8 to UTF-16), a conversion step at those draw sites, character-aware slicing instead of byte slicing, and a no-space line-breaking rule for the help text.

A shape that would scale to more languages

Keep the user-visible strings in one table per language (for example assets/lang/en.txt and assets/lang/zh-Hans.txt), English as the default with a per-key fallback, chosen by a new Menu language row and settable for a test run through hookshot_env.txt.

What I can hand over

I already have the full Simplified Chinese wording for every row, help text, value, map name and item name listed above (I translated the whole menu for my own use), and I would be glad to give it to you as the zh-Hans file. If it is easier, I can also do the layout half and send it as a patch.

One question from the same file: the README says the menu, the FPS counter and the start-up screen "use the game's own menu font, read from the romfs", but v2.0.11's vk_menu.cpp paints with Segoe UI through GDI. Which one is intended? It matters for this request: the game ships Font2/Font_CNzh.Product.100.Nin_Ounce_NVN2.bfarc.zs, so if the menu is meant to draw with the game's own font, a Chinese face is already present in every copy of the game, and the work is only the layout half.

Adding the Insert-menu detail you asked for above, since that is the menu I mean (Insert / F1 / controller Home). I went through the v2.0.11 source archive, so here is exactly what the Insert menu needs, in case it helps to scope the work. **Where the text lives** - `gpu/vk/vk_menu.cpp`: the `rows[]` table (26 rows, each a label plus a long help paragraph), the `tx_*()` value formatters ("Off" / "On" / "Custom" / "16:9 (restart)" / "Balanced (8GB)" ...), the tab names, the bottom hint lines, `teleport_names[]` (31 map names) and `pouch_items[]`. Roughly 380 string literals and 30 `TextOutA()` call sites. - `gpu/vk/oot_cheat_items.h`: the inventory editor's item names. **Why it is more than swapping the strings** The menu is painted with Win32 GDI, not with the game's font: - `font()` is `CreateFontA(-px, ..., DEFAULT_CHARSET, ..., "Segoe UI")`, a Latin-only face; - every draw goes through `TextOutA` / `GetTextExtentPoint32A`, the ANSI single-byte path, while the literals in the source are UTF-8, so a Chinese literal arrives as mojibake; - widths, the right-aligned value column and truncation are computed from `std::string::size()`, i.e. bytes: `marquee_pos()` slides a label by bytes, the not-selected case cuts it with "..." by bytes, and `wrap_help()` breaks lines at spaces. Chinese has no spaces and double-width glyphs, so a translated help paragraph runs off the panel and labels get cut mid-character. So a localization patch has to touch the face (Microsoft YaHei / Noto Sans CJK, or the W APIs with UTF-8 to UTF-16), a conversion step at those draw sites, character-aware slicing instead of byte slicing, and a no-space line-breaking rule for the help text. **A shape that would scale to more languages** Keep the user-visible strings in one table per language (for example `assets/lang/en.txt` and `assets/lang/zh-Hans.txt`), English as the default with a per-key fallback, chosen by a new **Menu language** row and settable for a test run through `hookshot_env.txt`. **What I can hand over** I already have the full Simplified Chinese wording for every row, help text, value, map name and item name listed above (I translated the whole menu for my own use), and I would be glad to give it to you as the `zh-Hans` file. If it is easier, I can also do the layout half and send it as a patch. **One question from the same file:** the README says the menu, the FPS counter and the start-up screen "use the game's own menu font, read from the romfs", but v2.0.11's `vk_menu.cpp` paints with `Segoe UI` through GDI. Which one is intended? It matters for this request: the game ships `Font2/Font_CNzh.Product.100.Nin_Ounce_NVN2.bfarc.zs`, so if the menu is meant to draw with the game's own font, a Chinese face is already present in every copy of the game, and the work is only the layout half.
NotRexed commented 2026-11-11 21:22:55 +00:00 (Migrated from github.com)

Thanks for the report. Reports of the same problem are now collected in #1007, which lists this one with your details and links back here, so one fix closes them together and the open list stays readable. Follow #1007 for the fix, and add new details there (or here). If this turns out to be a separate problem it will be reopened. Pull request #1864, #2417 works on this.

Thanks for the report. Reports of the same problem are now collected in #1007, which lists this one with your details and links back here, so one fix closes them together and the open list stays readable. Follow #1007 for the fix, and add new details there (or here). If this turns out to be a separate problem it will be reopened. Pull request #1864, #2417 works on this.
Commenting is not possible because the repository is archived.
No milestone
No assignees
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Hookshot#1566
No description provided.