Language Translation for QML ListElement.



  • Hi,

    Can some one help me in Translation of ListElement in QML.
    Sample Code is as below. And i have the .ts File with updated language text, but no Change in UI.

    ListModel {
        id: myModel
    
        ListElement {
            name: QT_TR_NOOP("Pressure")
        } 
        ListElement {
            name: QT_TR_NOOP("Control")
        }
        ListElement {
            name: QT_TR_NOOP("Check")
        }
    }
    

    Item{
    // -----------------------
    Component.onCompleted: {
    display.text = qsTr(myModel.get(index).name) //name
    }

    // -----------------------
    }


Log in to reply