Windows made of .ui files won`t show translations [solved]
-
Hi there I got a Problem with the qt translation system. I am using .ui files witch will be compiled with uic. I´ve made translations for them. But the windows made of .ui files always just show English. Tr() functions used directly in the source code are showing the right language. So what am I doing false?
-
Hi,
Did you follow this "document":http://qt-project.org/doc/qt-4.8/internationalization.html#dynamic-translation ?
-
Yes but i couldn't find anything helpful for solving my problem.
-
What about reimplementing the changeEvent and do all text settings there for your UI ?
-
Every ui file has a ui->translater() function in it.
In your changeEvent function call this function. If every ui file comes with his own class, do it for all in there own changeEvent:
@
void MainWindow::changeEvent(QEvent* event)
{
if (event->type() == QEvent::LanguageChange)
{
// retranslate designer form
ui->retranslateUi(this);
}
else
{
// remember to call base class implementation
QWidget::changeEvent(event);
}
}
@ -
Oh, btw, all widgets that use text (so is translatable) must have the translatable set! (This is the default, but just mentioned, you never know)
-
Jap its working!
thx!!! -
your welcome