New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial commit for multilingual UI, and Hungarian translation #1790
Conversation
Add the possibility to change runtime language, via --lang parameter. Also specify the verbose language code in the Hungarian translation.
A brief introduction to this language systemThe basic concept of this language system, that 86Box has a Win32 UI currently, which uses resources to display dialogs, menus, controls, etc. What's under the hood? The Windows itself allows to define multiple resources on the same name with different languages. This PR uses this feature to provide multilanguage UI with minimal changes. In order to achieve this the Changing the language Changing language is very complicated, because needs a heavy planning about how all the possibly localized in-memory contents should change when the language-switch occurs. Because of this I've decided about allowing the language-switch only at startup. This means that the selected display language is fixed for the whole run-time. Originally this system used the Windows's display language, without allowing to differ from it. By that in order to display the Hungarian UI, you had to use Hungarian Windows (or MUI). Introducing --lang or -G With the recent commits this behavior was changed, so you can choose between any translated languages you wish for 86Box, with the ˙-G ˙ or ˙--lang ˙ parameter. You can find a list about language codes here. Example In order to test 86Box in Hungarian, without having Hungarian Windows (or MUI), you can use the following command line.
How can I translate 86Box? 1, Look up for the desired language in the linked table above. |
…into translation_hu-HU
- Fix the broken itemindex of ComboBox in the Settings dialog - Change from LCID to uint32_t - Rewrite the headers of the lang related functions (can handle the whole LCID as input) - Add dummy functions to unix.c - Add proper combobox handling in win_settings.c - Added a lot of debug calls temporarily - Reactivate every disabled option related to language changes - Move lang_id to 86box.h from win.h - Implement on-fly resource switch as discussed with OBattler - Reimplement everything language related in the initialization section of the program - Implemented the ladder of three points 1, what is the --lang? 2, what are definied in the config? (to be implemented) 3, what is the system language
… code from pc_init
Also update everything and save the config without hard reset.
Move to translateable (System Default) message Move change language to Tools menu Redesign the language dialog Add the translators' name to the About dialog, to make the translation process more attractive
And remove some unnecessary stuff.
…into translation_hu-HU
Summary
This PR adds a kinda effortless solution to translate the current UI, via separating the RC file into multiple parts.
The UI translation after this PR can be added to
src\win\languagesby translatingen-US.rcand then adding a single line to86Box.rcto include the new translation. The language-dependent loading of resources are done with the existing code, and Windows itself, no further changes needed.The PR also adds a Hungarian translation for 86Box, as first translated language.
Edit: Even if an UI rewrite is in progress, I think the translations for multiple languages probably can re-used after the rewrite.
Checklist
References
https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-LCID/%5bMS-LCID%5d.pdf