Localization not working on OBS?

When I compile my app on QT Creator to one of the build targets everything works fine and the result is a rpm that loads on a device the right localized language version (i test that with German).
If I compile my package on OBS, e. g. for CHUM, and install then from CHUM GUI or with zipper, the app loads in the English localization. Same when I download the rpm from OBS and install it manually. However, the localization from the Qt side seems to be recognized as German, as texts that I fetch from a remote source are fetched in the correctly localized version.
Any Idea what I’m doing wrong there?

Check the build logs on OBS. It should show failure to run lrelease which results in the l10n files (.qm) not being built and not packaged.

If that is the case you must add a build dep on qt5-qttools-linguist to your .spec.

1 Like

Oh, indeed, that seems to be the problem. Do I have to write that to the (auto generated?) .spec directly, or could I also write something like - qt5-qttools-linguist in the PkgConfigBR: section of the yaml-file?
(If i write exactly that, SailfishSDKs qmake is not happy as it sais: No provider of 'pkgconfig(qt5-qttools-linguist)' found.)
I would be most happy, if I could still compile from SailfishSDK for harbour and on OBS for CHUM with the same code.

However, the .spec file is really missing its build dep, which shows in the failure of the (very minimal) build environment on OBS. The fact that it works in qtcreator/SailfishSDK is because that environment happens to include the linguist tools, despite the .spec file being incomplete…

So after adding the correct dep it will work on both, satisfying your requirement.

For a .yaml file, use

  - qt5-qttools-linguist

so not PkgConfigBR

For a .spec file that would be

BuildRequires: qt5-qttools-linguist
# or possibly this would work, although it's not exactly the correct requirement:
#BuildRequires: cmake(Qt5LinguistTools)

Indeed, that is working! Thanks, @nephros, for your help!