Important: Please read the Qt Code of Conduct -

Question on translations and .ts files

  • My current .ts file looks like

            <location filename="A.qml" line="10"/>

    I note that qsTr("History")

    • translates fine in A.qml, line 10
    • translates fine in A.qml, any other line
    • does not translate in B.qml (there is no entry yet in the .ts file for B)

    Is this expected behavior?

  • Moderators

    @Marc_Van_Daele said in Question on translations and .ts files:

    Is this expected behavior?

    yes it is,

    each source file (c++ or qml) has it's own contextblock

    by running lupdate on your project, a context block will be created for b . Then there will be an automatic check for similar heuristics, and the translation in A will be detected and preselected for you.

    IIRC running lrelease now will result in A and B being correctly translated, even without confirming the preselected translation before via (Qt)Linguist

  • Thanks for confirming and explaining!

Log in to reply