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 for qtbase do not appear
Qt 6.11 is out! See what's new in the release blog

Translations for qtbase do not appear

Scheduled Pinned Locked Moved Unsolved General and Desktop
11 Posts 4 Posters 1.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.
  • L Offline
    L Offline
    Luganda01
    wrote on last edited by Luganda01
    #1

    Hello,

    Could anyone help me with where I am going wrong please?

    I have been translating Qt and various applications that use it.
    The applications translate and work as expected, as exemplified by these shots of the PCManFM-Qt file manager from LXQt and the Falkon web browser.
    pcmanfm.png
    falkon.png

    However none of the elements from Qt itself show up translated, as seen in the shots of the print dialog (called up from Falkon) and the close button on the about dialog (called up from the PCManFM-Qt file manager).
    print.png
    about.png

    The translations are for Luganda (lg).
    This is at the start of the originating qtbase_lg.ts file:

    <?xml version="1.0" encoding="utf-8"?>
    <!DOCTYPE TS>
    <TS version="2.1" language="lg">
    

    The computer is running Linux (PCLinuxOS) with Qt 5.15.6.
    The locale setting is:

    LANG=lg_UG.UTF-8
    LC_CTYPE=lg_UG.UTF-8
    LC_NUMERIC=lg_UG.UTF-8
    LC_TIME=lg_UG.UTF-8
    LC_COLLATE=lg_UG.UTF-8
    LC_MONETARY=lg_UG.UTF-8
    LC_MESSAGES=lg_UG.UTF-8
    LC_PAPER=lg_UG.UTF-8
    LC_NAME=lg_UG.UTF-8
    LC_ADDRESS=lg_UG.UTF-8
    LC_TELEPHONE=lg_UG.UTF-8
    LC_MEASUREMENT=lg_UG.UTF-8
    LC_IDENTIFICATION=lg_UG.UTF-8
    LC_ALL=
    

    This particular flavour of Linux keeps the qtbase .qm file in

    /usr/share/qt5/translations/qtbase_lg.qm
    

    I get similar results on another computer running Lubuntu 25.04 that uses Qt 6.8.3 and sets its Luganda locale as:

    LANG=lg_UG.UTF-8
    LANGUAGE=
    LC_CTYPE=lg_UG.UTF-8
    LC_NUMERIC=lg_UG.UTF-8
    LC_TIME=lg_UG.UTF-8
    LC_COLLATE=lg_UG.UTF-8
    LC_MONETARY=lg_UG.UTF-8
    LC_MESSAGES=lg_UG.UTF-8
    LC_PAPER=en_GB.UTF-8
    LC_NAME=en_GB.UTF-8
    LC_ADDRESS=en_GB.UTF-8
    LC_TELEPHONE=en_GB.UTF-8
    LC_MEASUREMENT=lg_UG.UTF-8
    LC_IDENTIFICATION=en_GB.UTF-8
    LC_ALL=
    

    and the qtbase .qm file is in:

    /usr/share/qt6/translations/qtbase_lg.qm
    

    I will be grateful for any assistance with this.

    Regards,

    Kizito Birabwa

    1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      So did you load this qm file?

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      L 1 Reply Last reply
      0
      • Christian EhrlicherC Christian Ehrlicher

        So did you load this qm file?

        L Offline
        L Offline
        Luganda01
        wrote on last edited by
        #3

        @Christian-Ehrlicher
        Yes, those locations are where the file is on each of the computers that I described.
        I compiled and installed the one on PCLinuxOS, whilst the one on Lubuntu came with the installation.

        Pl45m4P 1 Reply Last reply
        0
        • L Luganda01

          @Christian-Ehrlicher
          Yes, those locations are where the file is on each of the computers that I described.
          I compiled and installed the one on PCLinuxOS, whilst the one on Lubuntu came with the installation.

          Pl45m4P Offline
          Pl45m4P Offline
          Pl45m4
          wrote on last edited by
          #4

          @Luganda01

          From what I've seen in other topics, I think the QStandardButtons, like the one in QDialog, which show Ok or Close are not translated by default in custom translation files.
          Maybe you have to add them manually?! Not sure about that


          If debugging is the process of removing software bugs, then programming must be the process of putting them in.

          ~E. W. Dijkstra

          Christian EhrlicherC 1 Reply Last reply
          0
          • Pl45m4P Pl45m4

            @Luganda01

            From what I've seen in other topics, I think the QStandardButtons, like the one in QDialog, which show Ok or Close are not translated by default in custom translation files.
            Maybe you have to add them manually?! Not sure about that

            Christian EhrlicherC Offline
            Christian EhrlicherC Offline
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @Pl45m4 said in Translations for qtbase do not appear:

            Maybe you have to add them manually?!

            That's why I asked if they are properly loaded like explained in the docs.

            Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
            Visit the Qt Academy at https://academy.qt.io/catalog

            L 1 Reply Last reply
            0
            • Christian EhrlicherC Christian Ehrlicher

              @Pl45m4 said in Translations for qtbase do not appear:

              Maybe you have to add them manually?!

              That's why I asked if they are properly loaded like explained in the docs.

              L Offline
              L Offline
              Luganda01
              wrote on last edited by
              #6

              @Pl45m4 @Christian-Ehrlicher
              Thanks.
              However, the link to https://download.qt.io/official_releases/online_installers/ offers downloaders but I didn't see any documentation.
              The one to https://academy.qt.io/catalog requires me to create an account and it is not obvious where the documentation is.
              In any case PCLinuxOS comes with Qt already installed. I followed the documentation/guidance at https://wiki.qt.io/Qt_Localization to create the .ts file and then used linguist to generate the .qm file from it and placed that with the other qtbase .qm files that came with the operating system.
              On Lubuntu the file came with the operating system.

              1 Reply Last reply
              0
              • Christian EhrlicherC Offline
                Christian EhrlicherC Offline
                Christian Ehrlicher
                Lifetime Qt Champion
                wrote on last edited by
                #7

                https://doc.qt.io/qt-6/localization.html#use-qt-module-translations

                Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                Visit the Qt Academy at https://academy.qt.io/catalog

                1 Reply Last reply
                1
                • J Offline
                  J Offline
                  jawadulhassan
                  wrote on last edited by
                  #8

                  Hi @Luganda01,
                  Your app translations work fine, but Qt base ones (like dialogs) may not load because:

                  The app might not be loading qtbase_lg.qm via QTranslator.

                  The .ts file may be incomplete or missing key UI strings.

                  Make sure the Qt version matches the .qm file (Qt 5 vs Qt 6).

                  Your locale looks okay, just confirm it’s set before launching the app.

                  Happy to help if you want to check the .ts or regenerate it with lrelease.

                  L 1 Reply Last reply
                  0
                  • J jawadulhassan

                    Hi @Luganda01,
                    Your app translations work fine, but Qt base ones (like dialogs) may not load because:

                    The app might not be loading qtbase_lg.qm via QTranslator.

                    The .ts file may be incomplete or missing key UI strings.

                    Make sure the Qt version matches the .qm file (Qt 5 vs Qt 6).

                    Your locale looks okay, just confirm it’s set before launching the app.

                    Happy to help if you want to check the .ts or regenerate it with lrelease.

                    L Offline
                    L Offline
                    Luganda01
                    wrote on last edited by Luganda01
                    #9

                    Hello @jawadulhassan,

                    Thanks for the guidance and the offer to check the .ts file, I would appreciate that a lot. How do I get it to you? There doesn't seem to be an option to attach it here (it is about 9000 lines long).

                    The .ts files are 100% translated.

                    The pictures are from PCLinuxOS, which uses Qt 5.15.6. The file is for Qt5 (branch 5.15-tr, which is purely for keeping the Qt 5 translations up-to-date). The output of the command locale is:

                    LANG=lg_UG.UTF-8
                    LC_CTYPE=lg_UG.UTF-8
                    LC_NUMERIC=lg_UG.UTF-8
                    LC_TIME=lg_UG.UTF-8
                    LC_COLLATE=lg_UG.UTF-8
                    LC_MONETARY=lg_UG.UTF-8
                    LC_MESSAGES=lg_UG.UTF-8
                    LC_PAPER=lg_UG.UTF-8
                    LC_NAME=lg_UG.UTF-8
                    LC_ADDRESS=lg_UG.UTF-8
                    LC_TELEPHONE=lg_UG.UTF-8
                    LC_MEASUREMENT=lg_UG.UTF-8
                    LC_IDENTIFICATION=lg_UG.UTF-8
                    LC_ALL=
                    
                    1 Reply Last reply
                    0
                    • Christian EhrlicherC Offline
                      Christian EhrlicherC Offline
                      Christian Ehrlicher
                      Lifetime Qt Champion
                      wrote on last edited by
                      #10

                      Again: Please show how you load the translations, esp. the one from qtbase. My link explains how to do so...

                      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                      Visit the Qt Academy at https://academy.qt.io/catalog

                      L 1 Reply Last reply
                      0
                      • Christian EhrlicherC Christian Ehrlicher

                        Again: Please show how you load the translations, esp. the one from qtbase. My link explains how to do so...

                        L Offline
                        L Offline
                        Luganda01
                        wrote on last edited by
                        #11

                        @Christian-Ehrlicher

                        I have read that link, thanks. The appropriate part was Deploy Translations.

                        • On PCLinuxOS, where I did the translations for qtbase: Beyond placing the qtbase_lg.qm files with the other qtbase_*.qm files I do not do anything else.

                        • On Lubuntu I simply installed the operating system and set the locale to Luganda, since everything was already provided. The distribution has incorporated the translation which I had submitted to Qt.

                        • list itemI have further investigated and find that, on Lubuntu, when the program LXImage-Qt invokes the print dialog it comes up properly translated. Also the 'Open', 'Close', 'Save' etc buttons on all of the LXQt elements in Lubuntu come up translated.
                          On PCLinuxOS they do not.

                        • On Lubuntu the program Leafpad doesn't get the translated buttons but it does get the fully translated print dialog. Firefox gets most (but not all) parts of the system print dialog translated.

                        As per the suggestion of @jawadulhassan, it may be that some of the programs don't load qtbase_lg.qm via QTranslator.

                        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