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. How to translate text on buttons of QDialogButtonBox
Forum Updated to NodeBB v4.3 + New Features

How to translate text on buttons of QDialogButtonBox

Scheduled Pinned Locked Moved General and Desktop
14 Posts 7 Posters 9.8k 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.
  • G Offline
    G Offline
    giesbert
    wrote on last edited by
    #4

    in the installation, you have the ts files and the qm files, so you can :-)
    You could also put that back to qt on git by merge request.

    Nokia Certified Qt Specialist.
    Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

    1 Reply Last reply
    0
    • S Offline
      S Offline
      soroush
      wrote on last edited by
      #5

      bq. in the installation, you have the ts files and the qm files, so you can :-)
      You could also put that back to qt on git by merge request.

      Could you explain more please? There is no .ts file in my /usr/share/qt4/. I've been installed Qt SDK 1.1.1. there isn't .ts files too.

      And where is git repository of that translations? I'll be happy to add Persian translation of Qt (if there is not any).

      1 Reply Last reply
      0
      • G Offline
        G Offline
        goetz
        wrote on last edited by
        #6

        You will have to call lupdate, grab the .ts files, translate it using Qt Linguist and create the .qm files with lrelease. It's the same way as you would translate a regular app. Then load the new .qm file in your application.

        http://www.catb.org/~esr/faqs/smart-questions.html

        1 Reply Last reply
        0
        • S Offline
          S Offline
          soroush
          wrote on last edited by
          #7

          bq. You will have to call lupdate, grab the .ts files, translate it using Qt Linguist and create the .qm files with lrelease. It’s the same way as you would translate a regular app. Then load the new .qm file in your application.

          Translate what?
          Sorry for my stupid questions but I'm really confused! As far as I know lupdate receives a .pro file, containing TRANSLATIONS += <lang>.ts to generate .ts files. So, what should I pass to lupdate to get translation files of Qt itself (probably containing titles of QDialogButtonBox) ?

          1 Reply Last reply
          0
          • G Offline
            G Offline
            goetz
            wrote on last edited by
            #8

            translate Qt - or the parts you need.

            http://www.catb.org/~esr/faqs/smart-questions.html

            1 Reply Last reply
            0
            • S Offline
              S Offline
              soroush
              wrote on last edited by
              #9

              Ok, I found that there is no ts file in Qt distribution. they are just in source code. (you didn't tell me this!) Now I have a new problem :-x ! ts files are not editable. I guess thats because there is no <location> after each <message> in declaration. so lupdate translations.pro in the /translations directory, results
              @Updating 'qt_<some language>.ts'...
              Found 0 source text(s) (0 new and 0 already existing)@
              for all existing translations. But it's possible to release them...

              Please tell me what I exactly should do to translate Qt to my language?

              1 Reply Last reply
              0
              • A Offline
                A Offline
                andre
                wrote on last edited by
                #10

                While I think that creating a Persian translation of Qt is a Good Thing(TM), if all you want is some translated buttons in your dialog, perhaps there is an easier way. You can just set the text for the buttons yourself (QDialogButtonBox::button() returns a pointer to the button), and use setText() on that button yourself.

                1 Reply Last reply
                1
                • G Offline
                  G Offline
                  giesbert
                  wrote on last edited by
                  #11

                  [quote author="soroush" date="1307558155"]bq. in the installation, you have the ts files and the qm files, so you can :-)
                  You could also put that back to qt on git by merge request.

                  Could you explain more please? There is no .ts file in my /usr/share/qt4/. I've been installed Qt SDK 1.1.1. there isn't .ts files too.

                  And where is git repository of that translations? I'll be happy to add Persian translation of Qt (if there is not any). [/quote]

                  You have to install the sources with the SDK maintanence tool (it's available on wiondows, I hope also on linux with the SDK). Then you find <SDK Dir>\QtSources\4.7.3\translations and there are the ts files

                  To see, how to add new translations to qt, have a look at the link for "contribute":http://developer.qt.nokia.com/contribute

                  Nokia Certified Qt Specialist.
                  Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    soroush
                    wrote on last edited by
                    #12

                    bq. You have to install the sources with the SDK maintanence tool (it’s available on wiondows, I hope also on linux with the SDK). Then you find <SDK Dir>\QtSources\4.7.3\translations and there are the ts files
                    To see, how to add new translations to qt, have a look at the link for contribute [developer.qt.nokia.com]

                    I'm unable to translate Qt ! ....

                    I followed "this instructions":http://developer.qt.nokia.com/wiki/Qt_Localization bun they don't work. make ts-<lang> does not worked for any language.

                    I have ts files in source directory when I open one of them with Qt Linguist, translations are not editable. calling `lupdate translations.pro' output is something like this for all of them:
                    @Updating 'qt_<some language>.ts'...
                    Found 0 source text(s) (0 new and 0 already existing)@
                    also lrelease generates .qm files.

                    I guess it's because of there is no <location> tag in ts files. there should be somewhere to add real sources for translations. I looked at translations.pro there are some variables unset:

                    @TEMPLATE = app
                    TARGET = qm_phony_target
                    CONFIG -= qt separate_debug_info sis_targets
                    CONFIG += no_icon
                    QT =
                    LIBS =@

                    Try to add paths of Qt objects and sources but not worked. ...

                    1 Reply Last reply
                    0
                    • G Offline
                      G Offline
                      Grunthor
                      wrote on last edited by
                      #13

                      I've got the same problem.
                      @Updating 'qt_<some language>.ts'...
                      Found 0 source text(s) (0 new and 0 already existing @
                      what can be the reason that blank file is created without any data?

                      1 Reply Last reply
                      0
                      • A Offline
                        A Offline
                        Anveshkumar
                        wrote on last edited by
                        #14

                        i have also problem in language change i am not getting how to write code for language change in Qt5 c++, how to start this code process of language change..please help me.

                        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