[akm] Add localization support#379
Conversation
khagaroth
commented
Mar 18, 2026
- add gettext support, replace translatable strings with printf_gettext calls
- add update_po_files script to generate / update POT and PO files
- remove Finnish comment from akm.desktop and move it to fi.po, treat akm.desktop as a template and generate localized .desktop file at build time
- add LANGUAGE setting to akm.conf to enable overriding UI language
- add Czech translation
- add gettext support, replace translatable strings with printf_gettext calls - add update_po_files script to generate / update POT and PO files - remove Finnish comment from akm.desktop and move it to fi.po, treat akm.desktop as a template and generate localized .desktop file at build time - add LANGUAGE setting to akm.conf to enable overriding UI language - add Czech translation
|
Thanks for your contribution! I'm planning on rewriting our translation system, and it will likely take a fair amount of time to implement. |
|
Just FYI adding the gettext support was relatively easy, but I did bump into a few gotchas. First, there is a bug that trips xgettext and breaks string extraction if the shell script contains a heredoc block with a single quote inside of it. Right now it requires a workaround - placing a comment with a single quote in it right after the heredoc. I reported this bug on the gettext bugtracker. Another thing is that bash multi-line string handling with $() command substitution is a PITA to work with as it strips any trailing newlines. Not a problem with pure bash with output to the command-line as it doesn't need to use command substitution. But strings passed to yad either need to use Anyway, if you switch to gettext for the translation system rewrite, generating only the POT file and handling the PO files using a Weblate project and |