Closed SkoricIT closed 3 years ago
Thank you! The patch looks generally fine, but I'll review it in more detail next week (and get a bit more familiar with gettext too). Yeah, seems like the build platforms are broken again, I'll have to start with fixing them first.
Ok, the build system should work now. If you rebase the branch to the current master, the checks should now run (though gettext is still probably not installed on the Windows one).
I merged in your change but the build is unfortunately still failing.
So, it seems gettext is part of Linux, thus does not require any more setup, but on Windows some more CMake steps are required (see FindIntl and FindGettext). Building on Windows is always a bit complicated, but I think some parts of this patch could be merged already; I'll fix the Windows builds myself later.
For now, please:
<root>/locale
, a new directory next to src
: after all, it's not really source codeI've also noticed some points of interest in the commits, will finish the review in a second. With the above changes, I'm happy to merge this, and I can fix the releases after that.
I will make the requested changes and update the pull.
I have performed the requested changes. Please be advised that localization is currently being read with a relative path (main.cpp:68 bindtextdomain ("main", "../locale");
) which you might want to change to fit your CMake configuration.
Thanks! I'll see if I can finish the CMake part this week or the next.
That would be great, thanks!
Ok, added gettext support through CMake, without any specific language, and tested it with some dummy translations.
To add a new translation, place it in the locale directory and add it at the top of locale/CMakeLists.txt
. In this case it would be at locale/de/main.po
and the CMake file should have set(LOCALES de)
. The build then handles generating and deploying the MO files automatically. I've also updated the POT with some default values (eg. project name).
With that, I'm closing this for now; feel free to open a new pull request for the German-specific changes!
This implements localization through gettext and adds an unfinished German translation file.
I think the process described in LANGUAGES.md could be streamlined with the makefile but I have no experience with that so I will leave this open.