Skip to content

Localization support#31

Open
WojtekMs wants to merge 4 commits into
ITachiLab:1.2.0-alphafrom
WojtekMs:localization-support
Open

Localization support#31
WojtekMs wants to merge 4 commits into
ITachiLab:1.2.0-alphafrom
WojtekMs:localization-support

Conversation

@WojtekMs

Copy link
Copy Markdown

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:

  • HotkeyDetective.exe
  • hook.dll

Now it has a structure:

  • HotkeyDetective.exe
  • hook.dll
  • localization.dll (required)
  • en-US/localization.dll.mui (required)
  • many more optional language packs

I restructured visual studio solution and projects to make it easier to manage language packs.

Let me know what you think :)

Wojciech Matusiak added 4 commits December 19, 2024 12:35
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.
@WojtekMs

Copy link
Copy Markdown
Author

I am also thinking about adding CI support to make sure that everything is actually compiling. What do you think?

@ITachiLab

Copy link
Copy Markdown
Owner

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...)

@ITachiLab ITachiLab added enhancement New feature or request ui Changes related mainly to UI labels Dec 23, 2024
@WojtekMs

Copy link
Copy Markdown
Author

Hi @ITachiLab I wanted to ask if you can review the code so this PR can be closed :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request ui Changes related mainly to UI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants