Results 1 to 17 of 17

Thread: Multilingual In Qt

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2012
    Location
    Hyderabad
    Posts
    82
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11
    Thanks
    5

    Smile Multilingual In Qt

    Dear Forums,


    I know that we can have multilingual concept in QT....As im very new to this concept can i get a small coding like i mean example so that i can look into and working on the remaining languages.....Hope you guys got me..........Thanks in advance........Any Solution would be appreciable....


    Regards,
    Last edited by StarRocks; 31st October 2012 at 06:25.

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

    Default Re: Multilingual In Qt

    Take a look at the QTranslator class. The docs there contain a couple of examples.
    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. #3
    Join Date
    Jul 2012
    Location
    Hyderabad
    Posts
    82
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11
    Thanks
    5

    Smile Re: Multilingual In Qt

    Dear Wysota,


    Thanks for the reply......The docs that you said doesn't contain the examples or sample code it would be good if someone provide me an example coding which would be very favourable....Thanks in advance......Any Solution would be appreciable...


    Regards,

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

    Default Re: Multilingual In Qt

    Quote Originally Posted by StarRocks View Post
    The docs that you said doesn't contain the examples or sample code
    Of course they do. Apart containing a minimal example of typical i18n, they link to at least two full-blown i18n examples -- troll print and arrow pad.
    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.


  5. #5
    Join Date
    Jul 2012
    Location
    Hyderabad
    Posts
    82
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11
    Thanks
    5

    Default Re: Multilingual In Qt

    Dear Wysota,


    Thanks for the reply......The docs that you said doesn't contain the examples or sample code it would be good if someone provide me an example coding which would be very favourable....Thanks in advance......Any Solution would be appreciable...


    Regards,

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Multilingual In Qt

    Is this ok?

    Qt Code:
    1. int main(int argc, char *argv[])
    2. {
    3. QApplication app(argc, argv);
    4.  
    5. QTranslator translator;
    6. translator.load("hellotr_la");
    7. app.installTranslator(&translator);
    8.  
    9. QPushButton hello(QPushButton::tr("Hello world!"));
    10. hello.resize(100, 30);
    11.  
    12. hello.show();
    13. return app.exec();
    14. }
    To copy to clipboard, switch view to plain text mode 
    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.


  7. #7
    Join Date
    Jul 2012
    Location
    Hyderabad
    Posts
    82
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11
    Thanks
    5

    Default Re: Multilingual In Qt

    Dear Wysota,

    Thanks for the reply........When i try to run the same its displaying me a button but what i need is when i select a message or some word and go for different languages it shld display me in that particular language.......That was my requirement.......Hope you got me now......Thanks in advance.....Any Solution would be appreciable ....


    Regards,

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Multilingual In Qt

    A solution is to Read The Fine Manual... I will not give you a complete solution for your problem. I can help you find one but will not do the work for you.
    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.


  9. #9
    Join Date
    Jul 2012
    Posts
    8
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanked 1 Time in 1 Post

    Default Re: Multilingual In Qt

    Hi, if you are looking for more examples, then take a look at one of my school projects, QGothic.

    Especially those files for example
    http://code.google.com/p/qgothic/source/browse/src/gsettingsdialog.cpp
    http://code.google.com/p/qgothic/sou...e/src/main.cpp

  10. #10
    Join Date
    Jul 2012
    Location
    Hyderabad
    Posts
    82
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11
    Thanks
    5

    Default Re: Multilingual In Qt

    Dear Wysota,

    Thanks for the reply........I am not asking for any complete solution Wysota....I was just asking for a reference like having a single language so that i cant work on my app i jus need a reference that all nothing more than that.....Any Solution would be appreciable........Thanks in Advance...


    Regards,

  11. #11
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Multilingual In Qt

    Quote Originally Posted by StarRocks View Post
    I am not asking for any complete solution Wysota....
    Yes, you are.

    I was just asking for a reference
    You were already given it -- twice. There are fine examples of complete localization process in QTranslator manual. Go there and keep reading it until you find them.
    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.


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.