Add more languages #1566
Labels
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
question
testing wanted
wontfix
No milestone
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Hookshot#1566
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
The idea
please!!!please!!!please!!!please!!!
Anything else
No response
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.txtbeside 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.
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: therows[]table (26 rows, each a label plus a long help paragraph), thetx_*()value formatters ("Off" / "On" / "Custom" / "16:9 (restart)" / "Balanced (8GB)" ...), the tab names, the bottom hint lines,teleport_names[](31 map names) andpouch_items[]. Roughly 380 string literals and 30TextOutA()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()isCreateFontA(-px, ..., DEFAULT_CHARSET, ..., "Segoe UI"), a Latin-only face;TextOutA/GetTextExtentPoint32A, the ANSI single-byte path, while the literals in the source are UTF-8, so a Chinese literal arrives as mojibake;std::string::size(), i.e. bytes:marquee_pos()slides a label by bytes, the not-selected case cuts it with "..." by bytes, andwrap_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.txtandassets/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 throughhookshot_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-Hansfile. 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.cpppaints withSegoe UIthrough GDI. Which one is intended? It matters for this request: the game shipsFont2/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.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.