Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Translation: duplicated string



  • Hi,
    In three qml files I have this string: qsTr("OK").

    When I run lupdate I get three duplicated "OK" strings to translate.

    How to tell lupdate not to duplicate same strings?

    Thanks


  • Qt Champions 2018

    @MartinD,

    In three qml files I have this string: qsTr("OK").

    It's recognized as a different translation target.
    If you want to have one target, what about implementing as Original QML Type?
    For Example as below

    TypeDef.qml

    import QtQuick 2.12
    
    Item {
        property string ok_string :  qsTr("OK")
    }
    

    Sample.qml

    import QtQuick 2.12
    
    Item {
        id: root_
    
        TypeDef { id: def_ }    /// define QML Type( include OK string)
    
        Text {
            text: def_.ok_string
        }
    }
    

Log in to reply