Please use [ code ] -tags around code blocks to make the readable. Notice the "#"-button in the wysiwyg-editor.
Please use [ code ] -tags around code blocks to make the readable. Notice the "#"-button in the wysiwyg-editor.
J-P Nurmi
thomasjoy (14th May 2007)
thanks for replying...
in your's example output is on already given text....but i am changing the text on run time
using text edit or line edit and selecting my language from combo box
so can you please suggest me the code example for my code
what changes i have to do in my code
required output is user enter the text in textEdit
i have the multiple languages list in combobox
user change the language from combobox as soon as user change the combobox's language string the textEdit's field or lineEdit's field language should also changed in that particular language which ever selected by user from combobox.
i mean i wanna know what i have to do here from above code
void langChange :: changed(QString str)
{
str=lineEdit->text();
QMessageBox::information(0,"!!",languageName(str)) ;
//WHT TO DO
}
thanks in advance
What does the line edit and/or the text edit contain? Are they read-only or is user allowed to enter basically anything?
J-P Nurmi
You can't translate dynamic text on the fly. It just wouldn't make sense. If you need it, do the translation manually upon QEvent::LanguageChange event.
it means to say we cannot change user given text on run time into another than english language....is it???
It means Qt translation tools are not a general use dictionary and don't support such a thing (and I've never heard of a i18n mechanism that would support it). You'd have to practically implement a complete context-detecting dictionary engine for that. The translation in Qt (or in gettext) concers static strings with optional arguments (that have to be translated separately), not free written text.
Bookmarks