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

QQmlApplicationEngine::retranslate do not work for strings in PropertyChange

    XMLWordPrintable

Details

    Description

      Consider the following example

      Column
      {
          property bool started: false
          
          Text
          {
              text: started?qsTr("Stop"):qsTr("Start")
          }
      
          Text
          {
              id: stateText
              
              states: [
                  State {
                      name: "stopped"
                      when: !started
                      PropertyChanges {
                          target: stateText
                          text: qsTr("Start")
                      }
                  },
                  State {
                      name: "started"
                      when: started
                      PropertyChanges {
                          target: stateText
                          text: qsTr("Stop")
                      }
                  }
              ]
          }
      }
      

       

      When I call QQmlApplicationEngine::retranslate, only the first text is correctly translated.

      It seems that once the PropertyChange has been applied at least once, the text is not translated anymore.

      Attachments

        Activity

          People

            shausman Simon Hausmann
            yoann Yoann Quenach de Quivillic
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: