Results 1 to 3 of 3

Thread: change language without restart app

  1. #1
    Join Date
    Nov 2009
    Posts
    59
    Thanks
    20
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default change language without restart app

    Qt Code:
    1. bool load=qTranslator->load("en_la");
    2. QApplication::installTranslator(qTranslator);
    3. m_UI->retranslateUi(this);
    To copy to clipboard, switch view to plain text mode 
    I want an app can change language without restart app, and i coded as above.
    But that code only run at fisrt correctly. but at second it is incorrect, that is mean that the language can change at the first, and from second can change language
    thanks

  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: change language without restart app

    Where do you put that code? Do you remove the old translator?
    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.


  3. The following user says thank you to wysota for this useful post:

    nthung (9th November 2011)

  4. #3
    Join Date
    Nov 2009
    Posts
    59
    Thanks
    20
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: change language without restart app

    thanks
    i fixed, by incorrect logic

Similar Threads

  1. Change UI Language of Qt Tools
    By shentian in forum Qt Tools
    Replies: 4
    Last Post: 10th July 2013, 08:45
  2. qml change local language
    By goli in forum Qt Programming
    Replies: 1
    Last Post: 29th May 2011, 12:20
  3. Change language of the application
    By franco.amato in forum Newbie
    Replies: 1
    Last Post: 14th October 2010, 22:45
  4. how change language at runtime?
    By mattia in forum Newbie
    Replies: 3
    Last Post: 14th November 2007, 18:36
  5. Replies: 8
    Last Post: 15th May 2007, 09:21

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.