Results 1 to 2 of 2

Thread: Multi language translation

  1. #1
    Join Date
    Feb 2010
    Location
    New delhi
    Posts
    10
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Multi language translation

    Dear All,
    I am using qt-embedded-linux-opensource-src-4.5.3 for my development.
    I want to use multi language conversion,
    I am doing in my application
    fun()
    {
    {
    QTranslator mTranslator;

    QString msStrLanguage[13];

    msStrLanguage[0]= QString(ENGLISH_QM);
    msStrLanguage[1]= QString(GERMAM_QM);
    msStrLanguage[2]= QString(NETHER_QM);
    msStrLanguage[3]= QString(SPAIN_QM);
    msStrLanguage[4]= QString(FRANCE_QM);
    msStrLanguage[5]= QString(ITALIA_QM);
    msStrLanguage[6]= QString(SWEDEN_QM);
    //msStrLanguage[6]= QString(POLAND_QM);
    msStrLanguage[7]= QString(PORUTO_QM);
    msStrLanguage[8]= QString(RUSSIA_QM);
    msStrLanguage[9]= QString(TURKEY_QM);
    msStrLanguage[10]= QString(TAI_QM);
    msStrLanguage[11]= QString(CHINA_QM);
    // msStrLanguage[12]= QString(JAPAN_QM);
    msStrLanguage[12]= QString(KOREA_QM);


    QString path ="/system/"+msStrLanguage[12] ;
    //path.append(Qtopia::qtopiaDir());
    //path.append(msStrLanguage[12]);

    qDebug("\n\n\n------- %%%%%%% $$$$ ( load path) 222 = %s \n\n",qPrintable(path));
    mTranslator.load(path);

    qApp->installTranslator(&mTranslator);
    }

    after this i am calling like

    m_pLabelHelpTools->setText(qApp->tr("Enter")); this for language translation.
    In target i have copied the .qm files with same /system/i18n/*.qm files.

    When i am calling the function its not getting translating the string.

    When i do configuration for qt in my build server i have not done any thing specially for translator

    So i need to add any thing in code path first, before do qmake?
    or what went wrong i am doing...?


    Please any one help me to make it work.
    Many many thanks in advance...for ur help.
    Kotha Bhaskar
    Lingam pally

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Multi language translation

    Your QTranslator object is local and it's destroyed when the function ends.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. 1.3.0 - UI Language
    By Asperamanca in forum Qt Tools
    Replies: 2
    Last Post: 16th December 2009, 12:19
  2. Qt language of choice
    By alecs1 in forum Qt Programming
    Replies: 4
    Last Post: 26th April 2009, 21:13
  3. Replies: 4
    Last Post: 6th February 2009, 12:21
  4. language translation
    By thomasjoy in forum Qt Programming
    Replies: 2
    Last Post: 11th May 2007, 10:25
  5. How can I add any other language
    By ethos0714 in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 22nd February 2006, 03:51

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.