PDA

View Full Version : QDialogButtonBox - translation of standard button text ("OK", "Cancel" etc.)



will49
27th October 2008, 23:00
I'm using a QDialogButtonBox in an app that will is being translated into Japanese etc. The text for the standard buttons in QDialogButtonBox such as "OK", "Cancel" etc. doesn't show up in my .ts translation files. I assumed the app was going to use the standard localized text for these buttons from the OS, but it doesn't look like this is done.

Do I have to localize the text for these standard buttons myself? If so, is the correct way to re-set the text for each of the standard buttons with the correct text but use "ts()"? Seems a bit strange to have to do it that way if so.

Thanks

wysota
27th October 2008, 23:23
Those buttons are translated in a separate file provided with Qt. It should be called qt_ja_jp.qm in case of the Japaneese language. Simply create a second translator in your application, load this file as the dictionary and install the translator alongside the proper translation of your application.

jpn
28th October 2008, 19:27
It's a bit hackish, but alternatively you can force those entries to appear in your application's .ts with QT_TRANSLATE_NOOP (http://doc.trolltech.com/4.4/qtglobal.html#QT_TRANSLATE_NOOP).

jonawebb
8th December 2011, 19:21
A detailed explanation of this is at http://doc.trolltech.com/4.4/i18n.html