Results 1 to 5 of 5

Thread: A problem about i18n

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2009
    Location
    Nanjing, China
    Posts
    46
    Thanks
    12
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default A problem about i18n

    Hi, there! I have a problem about i18n.

    I have added
    TRANSLATIONS += resources/locale/pw_zh_CN.ts
    into .pro file and use lupdate and linguist tools to get .qm file. Then I use the following code to install translators on my application:
    QTranslator appTranslator;
    qDebug() << appTranslator.load("../resources/locale/pw_zh_CN");
    qApp.installTranslator(&appTranslator);

    OK, the qDebug() output true which means Qt has successfully load .qm file. But when I tried to run my application, there were still original english words that defined in tr() on UI. I don't know why.

    I have tried to create a new project and do this as I said. It can translate this test window. I'm using QtCreator IDE.

    I really don't know why this happen, could you tell me how to solve this problem?

    Thank you!

    =========================
    PS: I have fixed this problem. It is because I use
    using namespace XXX;
    instead of
    XXX::AppCass::foo()
    in *.cpp files. But I still have a problem: only in one dialog it cannot translate, others are OK...
    Last edited by FinderCheng; 16th October 2009 at 06:40.

Similar Threads

  1. Problem with QAbstractListModel
    By eekhoorn12 in forum Qt Programming
    Replies: 3
    Last Post: 26th August 2009, 14:26
  2. Replies: 1
    Last Post: 23rd April 2009, 09:05
  3. Replies: 19
    Last Post: 3rd April 2009, 23:17
  4. Grid Layout Problem
    By Seema Rao in forum Qt Programming
    Replies: 2
    Last Post: 4th May 2006, 12:45
  5. fftw problem
    By lordy in forum General Programming
    Replies: 1
    Last Post: 16th March 2006, 21:36

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.