Wednesday, 7 August 2013

Qt just loads the translations of UI strings but not strings in the code

Qt just loads the translations of UI strings but not strings in the code

I have a lot of form and strings in my project that the translatable
strings are boxed in the tr() function. I translated all of strings by
Linguist, but when I load the correspond qm file, just the strings that
are in the UI being translated.
For example, if I had a form containing a label with "Hello World!" text,
it is translated to "Olleh Dlrow!"(just for say). But in the code if I
wrote:
if ( condition )
ui.setTitle(tr("MainWindow"));
else
ui.setTitle(tr("SecondaryWindow"));
no translation of MainWindow or SecondaryWindow is done and the original
text is shown.
Any idea? Thanks in advanced.

No comments:

Post a Comment