libx52/po
nirenjan 75f0125f54 feat: Add layout file parsing to x52d
This change is an initial step to adding support for profiles in x52d.
This will allow the user to create a keyboard layout in an easy to
read/write text based format, and have it compiled into a flat layout
that's easy for the daemon to parse and load into memory. This layout
can then be used to map a user's action key to the actual input usage
needed. This is necessary, because keyboards don't actually send the
character that is typed, but just the position on the keyboard. For
example, on a French AZERTY keyboard, the A key would actually send the
usage for `Keyboard_q_and_Q`. The OS would translate that into the
letter 'a' (or 'A' if Shift key is held) and pass that to the active
window.

This commit adds the full logic necessary for the layout loading,
validation and compiling, as well as tests for the compiler and loader.
2026-04-04 23:16:51 -07:00
..
LINGUAS Add internationalization support for x52test 2020-05-20 14:36:40 -07:00
Makevars Replace all references to x52pro-linux with libx52 2021-09-29 00:30:55 -07:00
POTFILES.in feat: Add layout file parsing to x52d 2026-04-04 23:16:51 -07:00
README.md cleanup: Remove autotools build infrastructure 2026-04-03 22:36:10 -07:00
libx52.pot feat: Add layout file parsing to x52d 2026-04-04 23:16:51 -07:00
meson.build fix: Treat NLS=auto as enabled 2026-03-12 15:53:30 -07:00
xx_PL.po feat: Add layout file parsing to x52d 2026-04-04 23:16:51 -07:00

README.md

Notes for translators

libx52 is slowly being migrated to use the GNU gettext library to support internationalization (i18n). Contributions are welcome to both update the existing code to use gettext, and to add new translations.

xx_PL

xx_PL is a translation of English strings into Pig Latin that is used in lieu of any real translations. This file is used to test that the translation functionality is working as expected.

Adding new code to i18n (maintainers)

Most code should be using the _("...") format to refer to a translatable string. Some strings can be left untranslated, but these are mostly just whitespace, such as line breaks.

Once you add new strings to be translated, update po/POTFILES.in to include any new files that have to be translated. The file path is relative to the root of the project.

The next step is to rebuild the translation template libx52.pot. From the repository root, run meson compile -C build libx52-update-po (adjust build to your build directory), or ninja -C build libx52-update-po. This also updates any translation files (with .po extension) to include the new source strings.

Adding new languages (translators)

Run msginit -l <language-code> libx52.pot to generate a new .po file for that language. Language code is a 2 letter ISO-639-1 code with an optional ISO-3166-1 region suffix. Edit this file to add your translation, and add the new language to po/LINGUAS.

po/LINGUAS must be in alphabetical order.

Testing the i18n functionality

TODO