installTranslator returns false
Unsolved
General and Desktop
-
Attempting to install qt_en.qm
QString translatorFileName = QLatin1String("qt_"); translatorFileName += language; qDebug() << "qt translator filename: " << translatorFileName; #if QT_VERSION >= 0x060000 qDebug() << "translationPath " << QLibraryInfo::path(QLibraryInfo::TranslationsPath); if (theQtTranslator.load(translatorFileName, QLibraryInfo::path(QLibraryInfo::TranslationsPath))) #else qDebug() << "translationPath " << QLibraryInfo::location(QLibraryInfo::TranslationsPath); if (theQtTranslator.load(translatorFileName, QLibraryInfo::location(QLibraryInfo::TranslationsPath))) #endif { bool r{ app.installTranslator(&theQtTranslator) }; Q_ASSERT(r); }
app.installTranslator returned false for qt_en.qm
from the following test:
if (translationFile->isEmpty()) return false;
do I need to special case qt_en??? Or check the file isn't empty in my own code?
David