The 'qml' render tool does not work with translations
Unsolved
General and Desktop
-
Dear all,
i have been using the "qml" (as in
6.2.4/gcc_64/bin/qml
) tool to render qml-scenes. It works nicely. But now we are using translations - with ID based solution. The C++ version works fine, and everything is good in that side, but i am unable to get theqml
tool to work with the translations.The example is like this:
import QtQuick import QtQuick.Layouts import QtQuick.Controls ApplicationWindow { id: root visible: true Text { color:"black" //% "Hello world!" text: qsTrId("text-id-main-hello"); } }
that is then produced translation file
update debug/main.qml -ts debug/translations_en.ts
and then i used
6.2.4/gcc_64/bin/linguist
to translate and 'release' the file to producetranslations_en.qm
(qml started with--translation debug/translations_en.ts
said loading failed)Now starting the qml then with:
% qml --verbose --translation debug/translations_en.qm debug/main.qml qml: Loaded translation file debug/translations_en.qm qml: Qt 6.2.4 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 10.3.1 20210422 (Red Hat 10.3.1-1)) qml: Using built-in configuration: default.qml qml: loading file:///XXXX/qml-translation-not-ok/debug/main.qml
But the view does not keep the translations (screenshot). Looking at the source/output it looks to me that the loading was ok.
Any ideas what i am doing wrong?