Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ruditimmermans opened this issue Feb 21, 2024 · 6 comments · Fixed by #74 or sailfishos-applications/flowplayer#68
Assignees
Labels
bug Something isn't working

Comments

@ruditimmermans
Copy link
Contributor

ruditimmermans commented Feb 21, 2024

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
Copy link
Collaborator

Olf0 commented Feb 24, 2024

@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 Fix the translation file got into the correct place #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.

@Olf0 Olf0 reopened this Feb 24, 2024
@eson57
Copy link

eson57 commented Feb 24, 2024

  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
Copy link
Contributor Author

  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 Olf0 changed the title [Bug] Language choice other language but FileCase keep it into English [Bug] TS files are not translated to QM files when building on OBS Feb 24, 2024
@Olf0
Copy link
Collaborator

Olf0 commented Feb 24, 2024

@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. 😖

@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
Copy link
Collaborator

Olf0 commented Feb 24, 2024

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 added a commit to sailfishos-applications/flowplayer that referenced this issue Feb 24, 2024
Olf0 added a commit to sailfishos-applications/flowplayer that referenced this issue Feb 24, 2024
* [flowplayer.spec] Let `TS`→`QM` file translation work on OBS
  Fixes [common issue \#68](sailfishos-applications/filecase#68).

* Update `flowplayer.changes` accordingly
@Olf0
Copy link
Collaborator

Olf0 commented Feb 24, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
3 participants