Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED] Ok and Cancel buttons localization
Qt 6.11 is out! See what's new in the release blog

[SOLVED] Ok and Cancel buttons localization

Scheduled Pinned Locked Moved General and Desktop
6 Posts 4 Posters 8.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Anticross
    wrote on last edited by
    #1

    I use russian and ukranian tr files to change language in my program, it all works fine but standard buttons such as Ok and Cancel or Apply don't change it's displayname. Is there any solution to translate standard buttons too ?

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      You will have to provide translations for "Qt itself":http://doc.qt.nokia.com/4.7-snapshot/internationalization.html#produce-translations as well.
      [quote]Qt itself contains over 400 strings that will also need to be translated into the languages that you are targeting. You will find translation files for French, German and Simplified Chinese in $QTDIR/translations, as well as a template for translating to other languages. (This directory also contains some additional unsupported translations which may be useful.)[/quote]

      1 Reply Last reply
      0
      • ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        Note that these translations come with Qt. You need to add the shipped translation files to your program's translator. Look at the chapter "Produce Translations" in the Internationalization with Qt document.

        1 Reply Last reply
        0
        • A Offline
          A Offline
          Anticross
          wrote on last edited by
          #4

          I tried to do like here: "":http://qt-project.org/faq/answer/how_can_i_translate_the_ok_and_cancel_buttons_when_using_the_static_qmessag
          I add qt_ru.ts file to my project in Visual Studio ad than go to main.cpp and write following:
          @QTranslator trans(0);
          trans.load("sxConfigAssc_ru", ".");
          QTranslator trans2(0);
          trans2.load("qt_ru", ".");
          a.installTranslator(&trans);
          a.installTranslator(&trans2);@

          But I don't know where I need to put:
          TEMPLATE = app
          SOURCES += main.cpp
          TRANSLATIONS = t1_fr.ts qt_fr.ts
          CONFIG += console

          Because I can't find any *.pro file in my Visual Studio solution. (I'm using qt 4.8.1 and vs-addin)

          1 Reply Last reply
          0
          • A Offline
            A Offline
            Anticross
            wrote on last edited by
            #5

            I forgot to add *.qm file to my solution now after added it all work OK.

            1 Reply Last reply
            0
            • ? Offline
              ? Offline
              A Former User
              wrote on last edited by
              #6

              As far as I can tell, standard buttons are translated in the context QPlatformTheme, which is missing in many of the qt_xx.ts files, with the exception of ru, ja, de, and a few others.

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved