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. change language in programm
Forum Updated to NodeBB v4.3 + New Features

change language in programm

Scheduled Pinned Locked Moved Unsolved General and Desktop
10 Posts 4 Posters 1.8k Views 3 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.
  • M Offline
    M Offline
    Michelle02283
    wrote on last edited by
    #1

    Hello, I need to translate the text on the StandardButtons in my programm into German, but I don´t know how to do it.
    I only need the file from qt.

    J.HilkJ 1 Reply Last reply
    0
    • M Michelle02283

      Hello, I need to translate the text on the StandardButtons in my programm into German, but I don´t know how to do it.
      I only need the file from qt.

      J.HilkJ Offline
      J.HilkJ Offline
      J.Hilk
      Moderators
      wrote on last edited by
      #2

      @Michelle02283
      you should be able to find the apropriate *.qm files on your system:
      Path/to/Qt/installation/Qt/Version(e.g.5.10.1)/Libary(e.g.mingw53_32)/translations


      Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


      Q: What's that?
      A: It's blue light.
      Q: What does it do?
      A: It turns blue.

      M 2 Replies Last reply
      1
      • J.HilkJ J.Hilk

        @Michelle02283
        you should be able to find the apropriate *.qm files on your system:
        Path/to/Qt/installation/Qt/Version(e.g.5.10.1)/Libary(e.g.mingw53_32)/translations

        M Offline
        M Offline
        Michelle02283
        wrote on last edited by
        #3

        @J.Hilk I found them but which one do I need?

        1 Reply Last reply
        0
        • J.HilkJ J.Hilk

          @Michelle02283
          you should be able to find the apropriate *.qm files on your system:
          Path/to/Qt/installation/Qt/Version(e.g.5.10.1)/Libary(e.g.mingw53_32)/translations

          M Offline
          M Offline
          Michelle02283
          wrote on last edited by
          #4

          @J.Hilk and how can I use them in my programm?

          J.HilkJ 2 Replies Last reply
          0
          • M Michelle02283

            @J.Hilk and how can I use them in my programm?

            J.HilkJ Offline
            J.HilkJ Offline
            J.Hilk
            Moderators
            wrote on last edited by
            #5

            @Michelle02283
            really depends on what part of qt you're using.

            The core part of the library should be with qt_(ISO 639-1-languagecode).qm covered, if you added a module in your pro file, fro example QT += serialport than you should also add the qtserialport_(ISO 639-1-languagecode).qm


            Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


            Q: What's that?
            A: It's blue light.
            Q: What does it do?
            A: It turns blue.

            1 Reply Last reply
            0
            • Pablo J. RoginaP Offline
              Pablo J. RoginaP Offline
              Pablo J. Rogina
              wrote on last edited by
              #6

              @Michelle02283 look at documentation here and examples here and here. You can translate your application's strings and you can use Qt's provided translations for the framework's strings.

              Upvote the answer(s) that helped you solve the issue
              Use "Topic Tools" button to mark your post as Solved
              Add screenshots via postimage.org
              Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

              1 Reply Last reply
              0
              • M Michelle02283

                @J.Hilk and how can I use them in my programm?

                J.HilkJ Offline
                J.HilkJ Offline
                J.Hilk
                Moderators
                wrote on last edited by
                #7

                @Michelle02283 with QTranslator of course

                for example:

                myTranslator = new QTranslator(this);
                qtTranslator= new QTranslator(this);
                
                myTranslator->load("myTranslation_de", myTranslationPathString);
                qtTranslator->load("qt_de", qtTranslationPathString);
                
                qApp->installTranslator(myTranslator);
                qApp->installTranslator(qtTranslator);
                

                Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                Q: What's that?
                A: It's blue light.
                Q: What does it do?
                A: It turns blue.

                M 1 Reply Last reply
                0
                • J.HilkJ J.Hilk

                  @Michelle02283 with QTranslator of course

                  for example:

                  myTranslator = new QTranslator(this);
                  qtTranslator= new QTranslator(this);
                  
                  myTranslator->load("myTranslation_de", myTranslationPathString);
                  qtTranslator->load("qt_de", qtTranslationPathString);
                  
                  qApp->installTranslator(myTranslator);
                  qApp->installTranslator(qtTranslator);
                  
                  M Offline
                  M Offline
                  Michelle02283
                  wrote on last edited by
                  #8

                  @J.Hilk I added this lines to my main.cpp. If I open a QMainWindow the StandardButton are not translated. Do I have to add some code into this class also?

                  J.HilkJ 1 Reply Last reply
                  0
                  • M Michelle02283

                    @J.Hilk I added this lines to my main.cpp. If I open a QMainWindow the StandardButton are not translated. Do I have to add some code into this class also?

                    J.HilkJ Offline
                    J.HilkJ Offline
                    J.Hilk
                    Moderators
                    wrote on last edited by
                    #9

                    @Michelle02283 you should really read through the links @Pablo-J-Rogina gave you. My example is incomplete.

                    For example you'll have to signal the UI to retranslate, if you apply the QTranslator after the ui-setup


                    Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                    Q: What's that?
                    A: It's blue light.
                    Q: What does it do?
                    A: It turns blue.

                    1 Reply Last reply
                    0
                    • mrdebugM Offline
                      mrdebugM Offline
                      mrdebug
                      wrote on last edited by
                      #10

                      Please download this
                      https://www.linux-apps.com/p/1127666
                      and have a look at the end of the file .pro, at the file mail.cpp and then in qtcreator tools -> external -> linguistics.

                      Need programmers to hire?
                      www.labcsp.com
                      www.denisgottardello.it
                      GMT+1
                      Skype: mrdebug

                      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