PDA

View Full Version : Multilingual In Qt



StarRocks
31st October 2012, 05:12
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,

wysota
31st October 2012, 07:48
Take a look at the QTranslator class. The docs there contain a couple of examples.

StarRocks
31st October 2012, 12:13
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,

wysota
31st October 2012, 14:52
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.

StarRocks
8th November 2012, 05:28
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,

wysota
8th November 2012, 12:06
Is this ok?


int main(int argc, char *argv[])
{
QApplication app(argc, argv);

QTranslator translator;
translator.load("hellotr_la");
app.installTranslator(&translator);

QPushButton hello(QPushButton::tr("Hello world!"));
hello.resize(100, 30);

hello.show();
return app.exec();
}

StarRocks
9th November 2012, 05:05
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,

wysota
9th November 2012, 05:46
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.

skunkos
9th November 2012, 06:25
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/source/browse/src/main.cpp)
http://code.google.com/p/qgothic/source/browse/src/main.cpp

StarRocks
9th November 2012, 07:15
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,

wysota
10th November 2012, 23:12
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.

ChrisW67
10th November 2012, 23:25
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.

StarRocks
15th November 2012, 05:17
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,

wysota
15th November 2012, 05:23
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...

StarRocks
21st November 2012, 05:37
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,

anda_skoa
21st November 2012, 18:41
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.

prof.ebral
23rd November 2012, 14:32
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.