Problem with QTranslator (by GNU gettext user)

c.buhtz at posteo.jp c.buhtz at posteo.jp
Sat Jun 17 15:43:54 BST 2023


I checked the directory under ~/.local.
It exists and is full of qm files.

So I tried to add the "qt_" prefix to the local.
If I interpret the output correct the files "qt_de.qm" and "qtbase_de.qm" are loaded.

But the GUI still is not translated. The buttons keep "Yes" and "No".

access("/home/user/.local/lib/python3.9/site-packages/PyQt5/Qt5/translations/qt_de_DE.qm", R_OK) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
access("/home/user/.local/lib/python3.9/site-packages/PyQt5/Qt5/translations/qt_de_DE", R_OK) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
access("/home/user/.local/lib/python3.9/site-packages/PyQt5/Qt5/translations/qt_de.qm", R_OK) = 0
stat("/home/user/.local/lib/python3.9/site-packages/PyQt5/Qt5/translations/qt_de.qm", {st_mode=S_IFREG|0644, st_size=153, ...}) = 0

openat(AT_FDCWD, "/home/user/.local/lib/python3.9/site-packages/PyQt5/Qt5/translations/qt_de.qm", O_RDONLY|O_CLOEXEC) = 16
access("/home/user/.local/lib/python3.9/site-packages/PyQt5/Qt5/translations/qtbase_de.qm", R_OK) = 0
stat("/home/user/.local/lib/python3.9/site-packages/PyQt5/Qt5/translations/qtbase_de.qm", {st_mode=S_IFREG|0644, st_size=220467, ...}) = 0
openat(AT_FDCWD, "/home/user/.local/lib/python3.9/site-packages/PyQt5/Qt5/translations/qtbase_de.qm", O_RDONLY|O_CLOEXEC) = 16

access("/home/user/.local/lib/python3.9/site-packages/PyQt5/Qt5/translations/qtscript_de.qm", R_OK) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
access("/home/user/.local/lib/python3.9/site-packages/PyQt5/Qt5/translations/qtscript_de", R_OK) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
access("/home/user/.local/lib/python3.9/site-packages/PyQt5/Qt5/translations/qtscript.qm", R_OK) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
access("/home/user/.local/lib/python3.9/site-packages/PyQt5/Qt5/translations/qtscript", R_OK) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)

So I realized that the other Qt application that works fine is started
via "python3 -Es" which results in the behavior that the python interpreter
do not use the environment variables. Using my own test script with "-Es"
and it is translated. Great!

But I can't find out which one of the environment variables do influence that behavior.
I can not see "/home/user/.local/lib" in that output:

env | grep -e QT -e XDG -e lib
QT_ACCESSIBILITY=1
XDG_CONFIG_DIRS=/etc/xdg
XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session0
XDG_MENU_PREFIX=xfce-
XDG_SEAT=seat0
XDG_SESSION_DESKTOP=xfce
XDG_SESSION_TYPE=x11
XDG_GREETER_DATA_DIR=/var/lib/lightdm/data/user
XDG_CURRENT_DESKTOP=XFCE
XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
XDG_SESSION_CLASS=user
QT_IM_MODULE=ibus
XDG_VTNR=7
XDG_SESSION_ID=1
XDG_RUNTIME_DIR=/run/user/1000
XDG_DATA_DIRS=/usr/share/xfce4:/usr/local/share/:/usr/share/:/usr/share


More information about the PyQt mailing list