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

Remove QM files from source tree; generate during build process #1111

Closed
jerogee opened this issue Feb 25, 2021 · 8 comments · Fixed by #3288
Closed

Remove QM files from source tree; generate during build process #1111

jerogee opened this issue Feb 25, 2021 · 8 comments · Fixed by #3288
Labels
tooling Changes to the automated build system

Comments

@jerogee
Copy link
Contributor

jerogee commented Feb 25, 2021

Translators are providing translations through translation source files (TS / .ts):

src/res/translation/translation_*.ts

Prior to release, these need to be turned into (QM / .qm) files and shipped with the app. Currently, this is done manually. QM files are in a compact binary format that is used by the localized application.

These QM files are currently sitting in the source tree:

src/res/translation/translation_*.qm

Suggested action:

  • QM files (binary blobs!) have no business residing in the source tree. And the ones that are currently in there are not consistently updated anyway. They also lead to confusion (e.g. see Updated Polish translation for 3.7.0 release #1099). To be removed.
  • These QM files should be generated as part of the build process.
@pljones
Copy link
Collaborator

pljones commented Feb 25, 2021

To specify this further... This needs to require no more than the existing command sequence for a build, something like:

make distclean ;# or make clean - I prefer distclean when developing to make sure nothing nasty got left over
qmake ;# alone or with CONFIG+= values at the user's discretion
make ;# alone
make clean ;# to leave the directory spotless with no `git status` differences

That should leave the Jamulus executable built with the latest translations from the .ts incorporated.

@hoffie
Copy link
Member

hoffie commented Feb 25, 2021

I'm all for it. In addition, people (the last one was me...) check in updated generated files by accident (still not sure which part sometimes updates them).

The only thing I'm wondering is if this would introduce new build-time dependencies (lrelease?). Might still be worth it though, but this could be something we would have to document.

@pljones
Copy link
Collaborator

pljones commented Feb 25, 2021

I think lrelease is part of the Qt developer tools -- if you've got qmake, you should have lrelease. Hopefully.

@jerogee
Copy link
Contributor Author

jerogee commented Feb 25, 2021

On Debian/Ubuntu: lrelease is part of qttools5-dev-tools, so installing only qt5-qmake will not be enough.

@pljones
Copy link
Collaborator

pljones commented Feb 26, 2021

I believe we say "Qt developer tools", not qt5-make in the requirements, however.

@pljones
Copy link
Collaborator

pljones commented Mar 4, 2021

I'll just note that when I do make distclean; qmake, grep lrelease Makefile on my Ubuntu box says

make distclean; qmake
...
Project MESSAGE: building version "3.6.2dev-090e8aca" (intermediate in git repository)
...
grep lrelease Makefile
                /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/lrelease.prf \
                /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/lrelease.prf \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/lrelease.prf:
compiler_lrelease_make_all: src/res/translation/translation_de_DE.qm src/res/translation/translation_fr_FR.qm src/res/translation/translation_pt_PT.qm src/res/translation/translation_pt_BR.qm src/res/translation/translation_es_ES.qm src/res/translation/translation_nl_NL.qm src/res/translation/translation_pl_PL.qm src/res/translation/translation_sk_SK.qm src/res/translation/translation_it_IT.qm src/res/translation/translation_sv_SE.qm
        /usr/lib/qt5/bin/lrelease src/res/translation/translation_de_DE.ts -qm src/res/translation/translation_de_DE.qm
        /usr/lib/qt5/bin/lrelease src/res/translation/translation_fr_FR.ts -qm src/res/translation/translation_fr_FR.qm
        /usr/lib/qt5/bin/lrelease src/res/translation/translation_pt_PT.ts -qm src/res/translation/translation_pt_PT.qm
        /usr/lib/qt5/bin/lrelease src/res/translation/translation_pt_BR.ts -qm src/res/translation/translation_pt_BR.qm
        /usr/lib/qt5/bin/lrelease src/res/translation/translation_es_ES.ts -qm src/res/translation/translation_es_ES.qm
        /usr/lib/qt5/bin/lrelease src/res/translation/translation_nl_NL.ts -qm src/res/translation/translation_nl_NL.qm
        /usr/lib/qt5/bin/lrelease src/res/translation/translation_pl_PL.ts -qm src/res/translation/translation_pl_PL.qm
        /usr/lib/qt5/bin/lrelease src/res/translation/translation_sk_SK.ts -qm src/res/translation/translation_sk_SK.qm
        /usr/lib/qt5/bin/lrelease src/res/translation/translation_it_IT.ts -qm src/res/translation/translation_it_IT.qm
        /usr/lib/qt5/bin/lrelease src/res/translation/translation_sv_SE.ts -qm src/res/translation/translation_sv_SE.qm

This appears to be the commit in question:

* 9c693d34 2021-01-06 use automatic lrelease operation on Qt 5.12 and up [mirabilos]

So I guess the question is do we support building on Qt5.9? I know we aim to support running on that platform for MacOS but is building on it required?

hoffie added a commit to hoffie/jamulus that referenced this issue Mar 18, 2021
This removes .qm files from git, adds them to .gitignore and changes
Jamulus.pro to generate the files dynamically during build in a way
which hopefully even works on ancient Qt versions.

Fixes jamulussoftware#1111
hoffie added a commit to hoffie/jamulus that referenced this issue Mar 18, 2021
This removes .qm files from git, adds them to .gitignore and changes
Jamulus.pro to generate the files dynamically during build in a way
which hopefully even works on ancient Qt versions.

This makes use of custom compiler support in qmake which seems to be
available (at least) as of Qt 5.5.
https://doc.qt.io/archives/qt-5.5/qmake-advanced-usage.html#adding-compilers

Fixes jamulussoftware#1111
@hoffie
Copy link
Member

hoffie commented Mar 19, 2021

I had opened a PR, but it looks like this might not work for all platforms (yet).

Related:
#799
#1304

@ann0see ann0see added this to Tracking Jul 1, 2023
@github-project-automation github-project-automation bot moved this to Triage in Tracking Jul 1, 2023
@pljones pljones added the tooling Changes to the automated build system label Aug 12, 2023
@ann0see ann0see added this to the Release 4.0.0 milestone Mar 31, 2024
@pljones pljones linked a pull request Jun 29, 2024 that will close this issue
5 tasks
@pljones
Copy link
Collaborator

pljones commented Jun 29, 2024

Closing, fixed by #3288

@pljones pljones closed this as completed Jun 29, 2024
@github-project-automation github-project-automation bot moved this from Triage to Done in Tracking Jun 29, 2024
@ann0see ann0see removed this from the Release 4.0.0 milestone Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tooling Changes to the automated build system
Projects
Status: Done
5 participants