Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-75746

QQmlApplicationEngine::retranslate doesn't work for binding text

    XMLWordPrintable

Details

    • Linux/X11

    Description

      Hi ,

      I create two translation files , English and Chinese file and use retranslate to change language dynamically.

      Here is simple code

      Rectangle {
          width: 100
          height: 100
          color: "yellow"
      
          property bool showText: false
          Text {
              text: parent.showText ? qsTr("text") : qsTr("no")
          }
          MouseArea {
              anchors.fill: parent
              onClicked: {
                  parent.showText = !parent.showText
              }
          }
      }
      

       
      Firstly I load my project in Chinese , then I change language to English .
      I find when I call retranslate to chang language , the text will be translated to English correctly.
      but when I change the property showText from false to true , it will show Chinese again.

       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            haipeng.yu Haipeng Yu
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes