Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. I try to load Qt translation file, but doesn't work
Forum Updated to NodeBB v4.3 + New Features

I try to load Qt translation file, but doesn't work

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 1.3k 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.
  • T Offline
    T Offline
    Toxsch
    wrote on last edited by
    #1

    When I upgrade my project to Qt 5.3.0, the app just doesn't show Qt translation like "OK","Cancel" and so on. I've loaded the translation file(qt_zh_CN.qm and qt_zh_TW.qm), but invalid.
    The Qt Creator 3.1.2 also doesn't show Chinese information in these text, so maybe there is something wrong with Qt translation file?
    my application is like this
    @
    QApplication app(argc, argv);
    QTranslator *sysTranslator = new QTranslator;
    sysTranslator->load("qt_zh_CN"), QTLIBPATH);
    app.installTranslator(sysTranslator);
    return app.exec();@

    1 Reply Last reply
    0
    • JeroentjehomeJ Offline
      JeroentjehomeJ Offline
      Jeroentjehome
      wrote on last edited by
      #2

      First easy test is to debug the load function if it does return TRUE. If not, the translator is not loaded and thus no translations are possible.
      Then did you run you QLinguist again to verify all the given strings?

      Greetz, Jeroen

      1 Reply Last reply
      0
      • K Offline
        K Offline
        koeniee
        wrote on last edited by
        #3

        Sorry for opening the topic again.

        I have got the same problem. Did you find a solution @Toxsch
        I made a new topic here:
        https://forum.qt.io/category/10/general-and-desktop

        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 Extensions
        • Unsolved