Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. installTranslator returns false
Qt 6.12 LTS is out! See what's new in the release blog

installTranslator returns false

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 278 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • PerdrixP Offline
    PerdrixP Offline
    Perdrix
    wrote on last edited by Perdrix
    #1

    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

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt
    • Unsolved