sailfishos-applications / filecase

File manager for SailfishOS
Other
8 stars 4 forks source link

[Bug] `TS` files are not translated to `QM` files when building on OBS #68

Closed ruditimmermans closed 5 months ago

ruditimmermans commented 5 months ago

When choice into the lasted version on Chum the language to Dutch, and restart FileCase it keep seems to be into English, i have look in the translate directory on my Xperia 10 III and it seems empty, the lasted version on OpenRepos works fine.

Olf0 commented 5 months ago

@ruditimmermans, please do use the bug template next time. By the language barrier and the relative information (e.g. "lasted", supposedly meaning "newest") it is hard to comprehend what you specifically mean: I crafted the templates to explicitly avoid such ambiguities.

  1. Do I understand correctly, that the Dutch localisation of FileCase works fine, when you install FileCase 0.4.3 from OpenRepos on an Xperia 10 III with the language set to Dutch in the SailfishOS Settings app?
  2. But there is no localisation (i.e. FileCase displays all strings in English) when you install Filecase 0.4.3 from SailfishOS:Chum (still on the Xperia 10 III set to Dutch)?
  3. Does devel-su ls -l /usr/share/filecase/translations/ output only total 0 in case 2, but shows the list of translation files in case 1?
  4. In your PR #69 you write that after your code changes there, "i have compile this with the sdk and translations would be there...". But the version at OpenRepos was also compiled with the SailfishOS-SDK (via Coderus' SailfishOS-SDK docker image executed by a GitHub CI workflow) and you wrote that it works fine for you. Have you compiled the original code from filecase-0.4.3.tar.gz or by checking out the git-tag rc4/0.4.3 from FileCase's git repository at GitHub, and then checked if the Dutch localisation works and /usr/share/filecase/translations/ is not empty?

Please answer each of the questions 1 to 4 starting with a "Yes" or "No". Actually you do not need to write more than that as each of the four answers, but feel free to write more, e.g. what exactly you observed for 4.

Note that it is absolutely plausible that a software compiled by the SailfishOS-OBS (e.g. apps from SailfishOS:Chum) shows different behaviour than the same source code compiled by the SailfishOS-SDK. But first and foremost I need to unambiguously comprehend your observations and statements.

Mind that SettingsAbout in Filecase 0.4.3-rc4 (= filecase-0.4.3-1.1.1 at SailfishOS:Chum), 0.4.3-rc2 and 0.4.2-rc1 all display "Version 0.4.2", unfortunately (as you already seem to have discovered), but pkcon search name filecase | fgrep installed always shows you the real version number of the installed FileCase app.

eson57 commented 5 months ago
  1. Yes
  2. Yes
  3. Yes
  4. I did not compile myself, but can tell that there are no translation files distributed from the Chum rpm (/usr/share/filecase/translations/ is empty), but they are all there from OpenRepos rpm.
ruditimmermans commented 5 months ago
  1. Yes
  2. Yes
  3. Yes
  4. Yes original code but the distributed from the Chum rpm (/usr/share/filecase/translations/ is empty), but they are all there from OpenRepos rpm.
Olf0 commented 5 months ago

@eson57, sorry for having triggered your attention and requested a reply, this was a mishap. Unfortunately (or rather: logically), a notification triggered by an "\@mention" cannot be revoked, because (dependent on the settings, but by default) an email with the triggering message is sent out (which technically cannot be revoked). Accidentally I also triggered (for the n-th time) the GH-user eson. :confounded:

@ruditimmermans, if the original code compiled fine (i.e. emitting translation files) using the Sailfish-SDK, why do you believe that your "fix" (PR #69) is correct by testing with the Sailfish-SDK: Logically the translation files are there, as long as your "fix" did not break anything.

Olf0 commented 5 months ago

After some testing where building the translation files fails (i.e. at the Sailfish-OBS), I conclude that the error message has always been (but nobody looked at it): [ 228s] lupdate: could not exec '/usr/lib/qt5/bin/lupdate': No such file or directory [ 228s] lrelease: could not exec '/usr/lib/qt5/bin/lrelease': No such file or directory

Full log: _log.txt

I suspect that something alike a BuildRequires: pkgconfig(qt5i18n) likely a BuildRequires: qt5-qttools-linguist statement is missing in the spec file. Must research further, but not today. Did it: lrelease and lupdate seem to be part of the package qt5-qttools-linguist on SailfishOS (on other Linux distros called qt%{api}-linguist-tools). This is presumably required, when specifying CONFIG += sailfishapp_i18n in the Qt project (.pro) file.

Side note: The Qt-Linguist tools are not a module (as) of Qt 5.6, AFAICS. This may be the reason why no .pc file for pkgconf / pkgconfig exists.

Olf0 commented 5 months ago

Generic Conclusion

If one when specifies CONFIG += sailfishapp_i18n in a Qt project (.pro) file (as suggested by Jolla), one must specify BuildRequires: qt5-qttools-linguist in the spec file of such a project to successfully generate .qm-files. Side note: Only inside the Sailfish-SDK the qt5-qttools-linguist RPM file seems to be already pre-installed.

Otherwise no Qt i18n (.qm) files are generated from the translation (.ts) input files, because lrelease and lupdate are not available.