Results 1 to 17 of 17

Thread: Multilingual In Qt

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

    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 05:25.

  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: 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
    Thanks
    5
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11

    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,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: 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
    Thanks
    5
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11

    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,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: 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
    Thanks
    5
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11

    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,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: 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
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    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
    Thanks
    5
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11

    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,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: 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.


  12. #12
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Multilingual In Qt

    I think StarRocks wants the equivalent of Google Translate to embed in his application so the user can highlight some words in a QTextEdit, for example, and have them magically "translated" into Hindi, Polish, Turkish, French etc. There also seems to be the expectation that words get translated by some magically automatic mechanism that does not require any effort on the part of the program author.

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

    Smile Re: Multilingual In Qt

    Dear Chris,


    Thanks for the reply.........Exactly that was the thing im talking about....I require the same that you are talking i require a sample example so that i can forward the same in my app...........Thanks in advance.....Any solution would be appreciable......

    Regards,

  14. #14
    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: Multilingual In Qt

    Quote Originally Posted by StarRocks View Post
    Dear Chris,


    Thanks for the reply.........Exactly that was the thing im talking about....I require the same that you are talking i require a sample example so that i can forward the same in my app...........Thanks in advance.....Any solution would be appreciable......

    Regards,
    ROTFL... just ROTFL...
    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.


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

    Default Re: Multilingual In Qt

    Dear Wysota,

    Thanks for the reply.........If im not wrong in most of the google searches i havent found anything related to Multilingual correct me if im wrong........Thanks in Advance.........Any solution would be appreciable.........

    Regards,

  16. #16
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Multilingual In Qt

    The class you are looking for is QNetworkAccessManager. It allows you to do HTTP calls to whatever web service you want to use for machine text translation. You will have to look into that web service's documentation on how that interaction works on the HTTP level, nothing Qt specific there.

  17. #17
    Join Date
    Feb 2010
    Posts
    96
    Thanks
    4
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Multilingual In Qt

    Quote Originally Posted by StarRocks View Post
    Any solution would be appreciable.
    https://developers.google.com/translate/

    Write an HTTP service that allows you to push the words you want translated to Google translate's API. That's one way to do it.
    You might also look into QTranslator, as was suggested. That seems like a good start.

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.