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. The 'qml' render tool does not work with translations

The 'qml' render tool does not work with translations

Scheduled Pinned Locked Moved Unsolved General and Desktop
qmltranslationstools
1 Posts 1 Posters 403 Views
  • 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.
  • S Offline
    S Offline
    supa5000
    wrote on last edited by
    #1

    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 the qml 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 produce translations_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?
    Screenshot_20221004_115514.png

    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