Results 1 to 4 of 4

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

  1. #1
    Join Date
    Jul 2007
    Posts
    56
    Thanks
    6
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Question QDialogButtonBox - translation of standard button text ("OK", "Cancel" etc.)

    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

  2. The following user says thank you to will49 for this useful post:

    Gecsevar (18th April 2011)

  3. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QDialogButtonBox - translation of standard button text ("OK", "Cancel" etc.)

    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.

  4. The following 2 users say thank you to wysota for this useful post:

    Gecsevar (18th April 2011), will49 (28th October 2008)

  5. #3
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QDialogButtonBox - translation of standard button text ("OK", "Cancel" etc.)

    It's a bit hackish, but alternatively you can force those entries to appear in your application's .ts with QT_TRANSLATE_NOOP.
    J-P Nurmi

  6. #4

    Default Re: QDialogButtonBox - translation of standard button text ("OK", "Cancel" etc.)

    A detailed explanation of this is at http://doc.trolltech.com/4.4/i18n.html

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.