Qt dialogs in other lenguages...
Hi,
I use QPrintDialog, QFileDialog, or QInputDialog in my Qt application, but when I use it I see it in english. Is it possible to translate to anothe language like spanish? I'm reading the Qt documentation but I'm not sure how to do it or if it is possible.
Thanks a lot
Re: Qt dialogs in other lenguages...
Hello !
You have to write all titles, texts etc. using tr() function and put file with translations in your project.
Re: Qt dialogs in other lenguages...
Read about QTranslator.
You must create new QTranslator and set it in QApplication object. This is example code from my application which is working with Polish language.
Code:
qTtranslator.load("qt_pl",":/Resources");
app.installTranslator(&qTtranslator);
In QT dir look for qt_??.qm files.
Re: Qt dialogs in other lenguages...
Put this code to the constuctor of the main window:
Code:
qApp->installTranslator(qtTranslator);
And read the documentation about the "Internationalization" item.