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. Translations not working after deployment
Forum Updated to NodeBB v4.3 + New Features

Translations not working after deployment

Scheduled Pinned Locked Moved Solved General and Desktop
17 Posts 5 Posters 1.4k 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.
  • kkoehneK Offline
    kkoehneK Offline
    kkoehne
    Moderators
    wrote on last edited by
    #6

    @hbatalha said in Translations not working after deployment:

    I thought that all the files in the resource file are compiled into the .exe but it is not happening with the .qm file as all the other files added in the resource seem to be working fine.

    Please show us your QTranslator::load() call. You most likely need to tweak it to actually load the .qm file's content from the resource system...

    Director R&D, The Qt Company

    H 1 Reply Last reply
    0
    • kkoehneK kkoehne

      @hbatalha said in Translations not working after deployment:

      I thought that all the files in the resource file are compiled into the .exe but it is not happening with the .qm file as all the other files added in the resource seem to be working fine.

      Please show us your QTranslator::load() call. You most likely need to tweak it to actually load the .qm file's content from the resource system...

      H Offline
      H Offline
      hbatalha
      wrote on last edited by
      #7

      @kkoehne

      Please show us your QTranslator::load() call.

      if( ! translatorPt.load(":/Languages/transl_portuguese.qm"))
              qDebug() << "not loaded";
      
      J.HilkJ 1 Reply Last reply
      0
      • H hbatalha

        @kkoehne

        Please show us your QTranslator::load() call.

        if( ! translatorPt.load(":/Languages/transl_portuguese.qm"))
                qDebug() << "not loaded";
        
        J.HilkJ Offline
        J.HilkJ Offline
        J.Hilk
        Moderators
        wrote on last edited by
        #8

        @hbatalha
        due, for the 3rd time

        translatorPt.load("transl_portuguese.qm", ":/Languages"))
        

        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
        • J.HilkJ J.Hilk

          @J-Hilk said in Check for QTranslator::load:

          @hbatalha
          what @nagesh meant is:

          translatorPt.load("transl_portuguese.qm", ":/Languages/"))

          file path is now your qrc system and not currentPath

          H Offline
          H Offline
          hbatalha
          wrote on last edited by
          #9

          @J-Hilk I supected that was what he meant so I tried that but didn't work also.

          J.HilkJ 1 Reply Last reply
          0
          • H hbatalha

            @J-Hilk I supected that was what he meant so I tried that but didn't work also.

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

            @hbatalha
            check out this thread
            https://forum.qt.io/topic/74995/load-qm-file-from-resource/15

            the op never responded after a couple of solution suggestions, I assume one of them works 🤷‍♂️


            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
            • H Offline
              H Offline
              hbatalha
              wrote on last edited by
              #11

              I have found out what was the problem. For some reason I don't know every time I build the application Qt Creator will create the binary in the debug folder even though I have it set to release.

              None of the changes I was making was actually taking effect since I was always checking .exe file from the release which was remaining unchanged the whole time.

              So I took the .exe from the debug folder and deployed it and all is working fine. Now I have to check what might me going when building my app cause the .exe is pretty big and I am not sure if is the release or the debug(it is in the debug folder, but I built it with release build set).

              I thank you all for the time and patience. I really appreciated it.

              1 Reply Last reply
              1
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #12

                Any chances you are on Windows ?

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                H 1 Reply Last reply
                0
                • SGaistS SGaist

                  Any chances you are on Windows ?

                  H Offline
                  H Offline
                  hbatalha
                  wrote on last edited by
                  #13

                  @SGaist

                  Any chances you are on Windows ?

                  Yeah I am on Windows 10 64 bit

                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #14

                    Using Visual Studio ?

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    H 1 Reply Last reply
                    0
                    • SGaistS SGaist

                      Using Visual Studio ?

                      H Offline
                      H Offline
                      hbatalha
                      wrote on last edited by
                      #15

                      @SGaist No, Qt Creator

                      1 Reply Last reply
                      0
                      • SGaistS Offline
                        SGaistS Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on last edited by
                        #16

                        I mean the compiler.

                        Interested in AI ? www.idiap.ch
                        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                        H 1 Reply Last reply
                        0
                        • SGaistS SGaist

                          I mean the compiler.

                          H Offline
                          H Offline
                          hbatalha
                          wrote on last edited by hbatalha
                          #17

                          @SGaist oh, it is mingw64 from msys2.

                          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