Skip to content

Call i18n.bindtextdomain with buildtime-determined locale path

Because we might be installed to a prefix that is outside of the assumption LUITK makes.

In Nixpkgs/NixOS, we need this because we install every package into its own prefix. The lomiri-terminal-app binary for example would end up in /nix/store/<hash>-lomiri-terminal-app-<version>/bin/lomiri-terminal-app, same with its locale catalogues. LUITK however assumes with its default bindtextdomain call that all locale catalogues for all applications are always available under one shared path, which isn't the case for us.

Some other core apps already have a separate i18n.bindtextdomain call which overrides this default with the application's own locale path, so I've ported that functionality over from those. Only difference is that I've opted to use GNUInstallDirs' full localedir variable instead of assuming anything about the exact path to the catalogues. The locale-installing code in the po directory already uses the localedir variable for the install location, so it made more sense to me.

Some points I'm unsure about:

  • I'm not sure how exactly you would like this to be implemented here. The other apps use a separate config.h.in to get information from CMake, along with some general application settings. Some config.h.ins also have more logic inside of them than others. The terminal app didn't have one at all yet so I introduced a new one, currently with just this locale path. Maybe some of the other data should be moved in there as well, or passing this via a plain define would be easier?

  • The QML test in tests/qtquicktest doesn't seem to be maintained/enabled on CI, so I didn't bother with checking if any adjustments for this are needed there.

  • We don't use the Click mode in Nixpkgs, so I haven't been able to test if this breaks catalogue loading there.

Merge request reports