Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.8.2
-
None
-
Windows 11 23H2
Python 3.12.4
PySide6 6.8.2.1
PyInstaller 6.13.0
Nuitka 2.5.1
-
All
Description
Steps to Reproduce
export LC_ALL=zh_CN.UTF-8 qml qtbug137871.qml
- Observe buttons are translated
- Remove files translations/qtmultimedia_zh_*qm from the Qt installation
- Launch app again: Note buttons are no longer translated
It looks like an ambiguous context/message
Original report against PySide
When a PySide6 Qt Quick application is deployed as a frozen executable (with PyInstaller or Nuitka) under the zh_CN locale, the standard button captions generated by QtQuick.Controls.Dialog (OK, Cancel, etc.) remain in English. The translations appear only if the file qtmultimedia_zh_CN.qm is shipped alongside the executable, even though the application itself does not import or use qtmultimedia.
Steps to Reproduce
- Unzip the attached example, build it with pyinstaller or nuitka under standalone mode, do not manually copy any .qm files.
Freezing command (example, PyInstaller):
pyinstaller main.py
- Run the generated executable on a system whose locale is Simplified Chinese or call QLocale.setDefault("zh_CN") as in the example.
- Observe the dialog buttons: English (OK, Cancel).
- Copy qtmultimedia_zh_CN.qm from the PySide6 installation’s translations/ directory into the same relative path under the frozen app.
- Run again, buttons now show Chinese (确定, 取消).
Expected Behavior
Dialog standard buttons should be translated to Chinese as long as the core translation files (qtbase_zh_CN.qm, qtquickcontrols2_zh_CN.qm, etc.) are present. Translations should not depend on the presence of any qtmultimedia translation files when the module is not used.
Actual Behavior
Without qtmultimedia_zh_CN.qm, button texts remain in English.