... and
I discover that qmake has produced another file that I have never heard of, qmake_qmake_qm_files.qrc. Content:
Code:
<!DOCTYPE RCC><RCC version="1.0">
<qresource prefix="[see below]">
<file alias="upsslideshow_fr_FR.qm">/home/michael/prog/upsslideshow/.qm/upsslideshow_fr_FR.qm</file>
<file alias="upsslideshow_de_DE.qm">/home/michael/prog/upsslideshow/.qm/upsslideshow_de_DE.qm</file>
</qresource>
</RCC>
Nothing I did not know, myself. Maybe someone knows what this file is supposed to do and why it does not help me.
THE GENERATIONS TO COME, HEAR ME
Edit:
qmake_qmake_qm_files.qrc is a default resource file, when nothing else is set (nothing *.qrc in the project file).
And:
Solved
The ominous path in the second argument to Translator.load() is a resource path. You can define your own, but if you choose to embed translations in your program, this path
does not need to point at an existing directory: It depends on the content of the *.qrc file:
Code:
qresource prefix="i18n">
This is from the automatically generated default resource file, when none is named in the project-file. The prefix “i18n” will serve as parameter to Translator.load():
Code:
[[maybe_unused]] bool isso = translator.load(QString("upsslideshow_") + locale, ":i18n");
The remainder of the configuration is made only in the project-file *.pro:
Code:
CONFIG += lrelease
CONFIG += embed_translations
TRANSLATIONS += upsslideshow_fr_FR.ts \
upsslideshow_de_DE.ts
You need *no* Prefixes other than i18n in the main.cpp (where the QTranslator is instantiated) and no file-paths whatsoever. lrelease will compile *.qm files to te directory “.qm” that is referenced in the default resource-file and the prefix i18n is enough to find it there.
Run qmake and make. Additional *.cpp- and *.h files will be generated, containing the translations, then compiled and linked in the executable.
Big Mess, but it works now.
Big mess in the documentation and all the discussions that I have found,