Translations for qtbase do not appear
-
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.


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).


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.qmI 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.qmI will be grateful for any assistance with this.
Regards,
Kizito Birabwa
-
So did you load this qm file?
-
So did you load this qm file?
@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. -
@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.From what I've seen in other topics, I think the
QStandardButtons, like the one inQDialog, which showOkorCloseare not translated by default in custom translation files.
Maybe you have to add them manually?! Not sure about that -
From what I've seen in other topics, I think the
QStandardButtons, like the one inQDialog, which showOkorCloseare not translated by default in custom translation files.
Maybe you have to add them manually?! Not sure about that@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.
-
@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.
@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. -
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.
-
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.
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
localeis: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= -
Again: Please show how you load the translations, esp. the one from qtbase. My link explains how to do so...
-
Again: Please show how you load the translations, esp. the one from qtbase. My link explains how to do so...
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.
-