jamulus icon indicating copy to clipboard operation
jamulus copied to clipboard

Remove QM files from source tree; generate during build process

Open jerogee opened this issue 3 years ago • 7 comments

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 #1099). To be removed.
  • These QM files should be generated as part of the build process.

jerogee avatar Feb 25 '21 10:02 jerogee

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.

pljones avatar Feb 25 '21 20:02 pljones

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.

hoffie avatar Feb 25 '21 20:02 hoffie

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

pljones avatar Feb 25 '21 20:02 pljones

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

jerogee avatar Feb 25 '21 21:02 jerogee

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

pljones avatar Feb 26 '21 08:02 pljones

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?

pljones avatar Mar 04 '21 08:03 pljones

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

Related: https://github.com/jamulussoftware/jamulus/pull/799 https://github.com/jamulussoftware/jamulus/issues/1304

hoffie avatar Mar 19 '21 11:03 hoffie