PDA

View Full Version : QFileDialog's Translation



santosh.kumar
9th February 2011, 04:36
Hi

I want to translate QFileDialog into German. i used


QString str = "qt_de" ;//+ QLocale::system().name();

QTranslator qtTranslator;
bool bloadapp = qtTranslator.load(str ,TranslatorPath);
app.installTranslator(&qtTranslator);

qt_de is the default .qm file provided by Qt.

But problem is that all Qt's messages, button, menubar translated but QFileDialog's button like New Folder, Save, Open is not translated.

Somebody told that use flag QFileDialog:ontUseNativeDialog

So I Used like this

QString str = QFileDialog::getExistingDirectory(this,"Open","/Volumes/",QFileDialog::QFileDialog:ontUseNativeDialog);

Yeah Its translated,,but sometimes its crashes happens while Browse.

Is there any other way instead of QFileDialog:ontUseNativeDialog.

wysota
9th February 2011, 20:08
Contents of the native dialog are out of reach for Qt. You need to find out what is required by the native dialog provider (like MacOS, KDE, Gnome, etc.) to translate the entries in the dialog.

santosh.kumar
14th February 2011, 03:33
Hi

Is there other way to translate QFileDialog without using QFileDialog:DontUseNativeDialog
for below:
QString str = QFileDialog::getExistingDirectory(this,"Open","/Volumes/",QFileDialog:DontUseNativeDialog) ;

QString str = "qt_de" ;//+ QLocale::system().name();

QTranslator qtTranslator;
bool bloadapp = qtTranslator.load(str ,TranslatorPath);
app.installTranslator(&qtTranslator);

qt_de is the default .qm file provided by Qt.

Kindly reply this.

wysota
14th February 2011, 17:57
Which part of my previous reply you didn't understand?

santosh.kumar
15th February 2011, 08:07
Which part of my previous reply you didn't understand?


ontents of the native dialog are out of reach for Qt. You need to find out what is required by the native dialog provider (like MacOS, KDE, Gnome, etc.) to translate the entries in the dialog.

Hi

As u told, contents of the native dialog are out of reach for Qt. I have not much idea about MacOS's Native Dialog. Kindly tell me some syntax/example code for translate QFileDialog.

Thanks
Santosh

wysota
17th February 2011, 21:33
I have told you that QFileDialog can't translate the native dialog. You either use the non-native one or have to ask your OS to provide a translated native dialog for you.