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 use tr () for ui widgets
Forum Updated to NodeBB v4.3 + New Features

How to use tr () for ui widgets

Scheduled Pinned Locked Moved General and Desktop
27 Posts 4 Posters 10.2k 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.
  • P Offline
    P Offline
    pragati
    wrote on last edited by
    #16

    Exactly followed these steps....:(

    Tried giving absolute path to .qm file also still nothing....

    My code is having many ui forms...I have translated only single screen's ui into german....expecting that after run, that screen only will show in german....
    This cant be any reason for my problem??

    1 Reply Last reply
    0
    • R Offline
      R Offline
      Rahul Das
      wrote on last edited by
      #17

      You are installing [[doc:QTranslator]] to app. Not just a class.

      whats the result of
      @qDebug()<< translator.load("/path/to/setup_de");@ ?


      Declaration of (Platform) independence.

      1 Reply Last reply
      0
      • P Offline
        P Offline
        pragati
        wrote on last edited by
        #18

        Will check..... :)

        1 Reply Last reply
        0
        • P Offline
          P Offline
          pragati
          wrote on last edited by
          #19

          Result is "True"
          :P

          1 Reply Last reply
          0
          • P Offline
            P Offline
            pragati
            wrote on last edited by
            #20

            :(

            Followed the steps for a new project in which there is just one form and one main.cpp and nothing else ....(just to try changing ui in other language)
            It was working fine....But not happening in the code where there are so many Ui forms....what could be the reason?

            1 Reply Last reply
            0
            • R Offline
              R Offline
              Rahul Das
              wrote on last edited by
              #21

              Its doesn't matter if you have a single ui, or multiple ui. Eventually, all these UI files are turning one class each. So lets see it as classes.
              In other words, it doesn't matter how many classes are there or not.

              When you change your language, all you got to do is 1.load the qm, 2.call retranslateUi.

              May be your qm/ts are not correct ?


              Declaration of (Platform) independence.

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

                [quote author="pragati" date="1348295432"]I got this post twice by mistake...I know about the "edit" :)
                Want to delete this post.....[/quote]

                I deleted it for you. If you want, you can use the "report" link next to each post to request moderator attention for your post. If you say that you want it deleted because it is double, a mod will take care of it.

                1 Reply Last reply
                0
                • P Offline
                  P Offline
                  pragati
                  wrote on last edited by
                  #23

                  Thanks Andre.....
                  :)

                  1 Reply Last reply
                  0
                  • P Offline
                    P Offline
                    pragati
                    wrote on last edited by
                    #24

                    Is it necessary to load translation files in main.cpp??

                    1 Reply Last reply
                    0
                    • R Offline
                      R Offline
                      Rahul Das
                      wrote on last edited by
                      #25

                      Its not mandatory to load in main.cpp. You can Do it anywhere you like.

                      If you are not defining a translator in main.cpp, make sure it is accessible from other objects.


                      Declaration of (Platform) independence.

                      1 Reply Last reply
                      0
                      • P Offline
                        P Offline
                        pragati
                        wrote on last edited by
                        #26

                        Yes....Thanks Rahul, I tried it is working now...just didn't completed translation for all ui's so it was not happening...
                        Thanks everybody

                        1 Reply Last reply
                        0
                        • R Offline
                          R Offline
                          Rahul Das
                          wrote on last edited by
                          #27

                          Good. Note that, it will check the translations in the reverse order you installed them.

                          And you can mark the post as Solved ;)


                          Declaration of (Platform) independence.

                          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