Localization support#31
Conversation
Hotkey Detective code is now loading localized resources dynamically from a DLL module. This allows to add support for many languages without recompiling and redeploying app itself. In order to add support for new language, the only thing you have to do is to deploy new language pack (MUI file)
"project" is renamed to "en_us" as it contains English language assets Some additional resources are stored in en_us.rc (like timer identifier) like previously were stored in project.rc Minor updates in CMakeLists: set UNICODE definition target based, as global setting did not work for me when I used Ninja generator instead of Visual Studio
en_us is used instead
Added languages: - German - Italian - Spanish Restructured solution location. Previously solution called "project" located in detective/res/project is not moved to a solution called "res" in detective/res folder. Each language pack is added as a project inside solution "res". This allows to easily add language specific resources.
|
I am also thinking about adding CI support to make sure that everything is actually compiling. What do you think? |
|
Hi! Many thanks for your contribution, I really appreciate :). I'm having a busy period right now, so I can't check the PR meticulously, but I should find some time after New Year's Eve. Does that sound good? About the CI support, there's a branch already where I did some work towards enabling Github actions: https://github.com/ITachiLab/hotkey-detective/tree/github-actions. Surprisingly it's working and even producing artifacts :D. You can take a look, and if you have any suggestions, then every PR would be very welcomed. (I must merge it eventually...) |
|
Hi @ITachiLab I wanted to ask if you can review the code so this PR can be closed :) |
Hey. This PR aims to address #12
This is my first time contributing to a Windows based project, so I am not sure if I've done everything according to the best practices.
This implementation follows the MUI documentation from Microsoft, which allows to add support for language packs dynamically without recompiling and redeploying the app. The only thing that is required is to provide language packs as MUI files and one DLL library.
I tested this code on my local machine (builds both using Visual Studio and Ninja). This implementetion chooses one of the supported languages (English, Polish, Italian, Spanish, German) based on system language. In case system language is not in the supported set application falls back to English. However, because the app falls back to english it is now required to support at least this one language pack in order to run the app.
Before this PR hotkey detective released package had the structure:
Now it has a structure:
I restructured visual studio solution and projects to make it easier to manage language packs.
Let me know what you think :)