Results 1 to 2 of 2

Thread: QT Language auto

  1. #1
    Join Date
    Jan 2007
    Location
    Paris
    Posts
    459
    Thanks
    98
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4 Qt5

    Default QT Language auto

    Hey there trolltechs,

    In a Qt code, is it possible to get the OS's current language ?

    Thanks.

  2. #2
    Join Date
    May 2006
    Posts
    788
    Thanks
    49
    Thanked 48 Times in 46 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QT Language auto

    Quote Originally Posted by bunjee View Post
    Hey there trolltechs,

    In a Qt code, is it possible to get the OS's current language ?

    Thanks.
    I dont know if XP professional MUI bug is fix
    i use this here.. to Mac,Linux, Window 98 >

    Qt Code:
    1. static inline QString UserLanguage()
    2. {
    3. QString languser,languagesistem,langqt;
    4. QLocale loci = QLocale::system();
    5. languser = getenv("LANG");
    6. languser = languser.toLower();
    7. languagesistem = loci.name();
    8. languagesistem = languagesistem.toLower();
    9. languagesistem = languagesistem.left(2);
    10. /* Window XP Prof MUI Multiuser == stay only "c" language && user setting setenv !!! */
    11. if (languagesistem == "c") {
    12. if (languser.size() > 2 && languser.contains("_")) {
    13. languagesistem = languser.left(2);
    14. }
    15. }
    16. return languagesistem;
    17. }
    To copy to clipboard, switch view to plain text mode 

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

    bunjee (4th April 2008)

Similar Threads

  1. Delete auto pointer from QMultiMap
    By phillip_Qt in forum Qt Programming
    Replies: 5
    Last Post: 3rd December 2007, 17:29
  2. Replies: 8
    Last Post: 15th May 2007, 09:21
  3. Discovery correct Language on all OS
    By patrik08 in forum Qt Programming
    Replies: 5
    Last Post: 25th February 2007, 19:27
  4. Auto update module
    By munna in forum General Discussion
    Replies: 3
    Last Post: 26th September 2006, 14:52
  5. How can I add any other language
    By ethos0714 in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 22nd February 2006, 02: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.