[Interest] Issues loading Qt's meta catalog translation files

Julius Bullinger julius.bullinger at gmail.com
Thu Jul 2 18:16:48 CEST 2020


Hi,

from the Qt Linguist documentation [1]:

> In Qt 4, there is one big, monolithic .qm file per locale. For > example, the file qt_de.qm contains the 
German translation of all > libraries. > > In Qt 5, the .qm files were 
split up by module and there is a > so-called meta catalog file which 
includes the .qm files of all > modules. The name of the meta catalog 
file is identical to the name > of Qt 4's monolithic .qm file so that 
existing loader code works as > before provided all included .qm files 
are found.

However, loading the meta catalog with QTranslator doesn't seem to work:

#include<QApplication>
#include<QTranslator>

intmain(intargc,char*argv[]){
QApplicationapp(argc,argv);
QTranslatortranslator;

boolloaded_qtbase_file=translator.load(
"C:/Qt/5.15.0/msvc2019_64/translations/qtbase_de.qm");//true
boolloaded_meta_file=translator.load(
"C:/Qt/5.15.0/msvc2019_64/translations/qt_de.qm");//false

returnapp.exec();
}

Is this supposed to still work? If yes, what is wrong here? If not, what 
is the purpose of those (legacy?) meta catalog files?

Thanks

Julius


[1]: https://doc.qt.io/qt-5/linguist-programmers.html#deploying-translations

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20200702/25d55445/attachment.html>


More information about the Interest mailing list