×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Oct 2009
    Posts
    95

    Question localization during run time?

    how can i change the localization during run time?
    note i am using maemo and c with hildon

  2. #2
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: localization during run time?

    I'm not sure I'm following the question, but this is how you switch translation language in Qt:

    Code:
    #include <QDebug>
    #include <QCoreApplication>
    #include <QApplication>
    #include <QTranslator>
    #include <QSpinBox>
    #include <QLibraryInfo>
    
    int
    main (int argc,
          char **argv)
    {
        QTranslator translator;
        QApplication app( argc, argv );
    
        if (!translator.load("qt_uk", QLibraryInfo::location(QLibraryInfo::TranslationsPath))) {
            qDebug("Cannot load file");
        }
        app.installTranslator(&translator);
    
        qDebug() << QSpinBox::tr("More");
    
        if (!translator.load("qt_ru", QLibraryInfo::location(QLibraryInfo::TranslationsPath))) {
            qDebug("Cannot load file");
        }
    
        qDebug() << QSpinBox::tr("More");
    
        if (!translator.load("qt_es", QLibraryInfo::location(QLibraryInfo::TranslationsPath))) {
            qDebug("Cannot load file");
        }
    
        qDebug() << QSpinBox::tr("More");
    }
    Note you need libqt4-core-translations to be installed.
    Last edited by divanov; 2009-11-19 at 15:10.

Similar Threads

  1. Database File creating in Run time...
    By keerthi.ck06 in forum Symbian
    Replies: 18
    Last Post: 2009-07-13, 11:15
  2. Multi-language support at run time and tabs
    By ramanathan_s12 in forum Symbian
    Replies: 7
    Last Post: 2009-07-03, 16:18
  3. How to add and remove menu items on run time
    By somnathbanik in forum Symbian
    Replies: 1
    Last Post: 2009-06-04, 09:41
  4. URL do not fire in S60 2nd Ed emulator
    By gigglie in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2008-02-20, 09:43
  5. run midlet at fixed time
    By trmtri in forum Mobile Java General
    Replies: 1
    Last Post: 2003-10-26, 13:33

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×