Translation QFileDialog standart buttons ("Open"/"Save"/"Cancel")
Hi all!
I am translating my application to russian using standart Qt tools. Everything works fine, but some strings are still english. For example "Save", "Open" and "Cancel" in QFileDialog, invoking by static functions like getOpenFileName(...).
How to translate these strings?
PS. Using Qt 4.3.3/Linux, system locale (LANG and LC_ALL) is ru_RU.UTF8
Re: Translation QFileDialog standart buttons ("Open"/"Save"/"Cancel")
Subclass this window and then manually create wished buttons, and then you can translate them in same fashion like other buttons.
Re: Translation QFileDialog standart buttons ("Open"/"Save"/"Cancel")
Translation files are shipped with Qt. See $QTDIR/translations/qt_*.ts.
Alternatively you can force those entries to appear in your application's .ts for example with QT_TRANSLATE_NOOP.
Re: Translation QFileDialog standart buttons ("Open"/"Save"/"Cancel")
Quote:
Originally Posted by
jpn
Translation files are shipped with Qt. See
$QTDIR/translations/qt_*.ts.
Alternatively you can force those entries to appear in your application's .ts for example with
QT_TRANSLATE_NOOP.
jpn, was my idea good or bad?
Re: Translation QFileDialog standart buttons ("Open"/"Save"/"Cancel")
Quote:
Originally Posted by
MarkoSan
jpn, was my idea good or bad?
Well, then he couldn't use the convenient static method (which creates an instance of QFileDialog) but he would have to instantiate a custom subclass by hand. Don't you think using built-in translation mechanisms is better anyway than writing custom subclasses for everything you want to translate? ;)
Disclaimer: But of course, when using those static methods of QFileDialog, this approach will only work on X11 because native dialogs are used on Windows and Mac.