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

lupdate fails to recognize translator comment in ternary operator construct

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.6.0 RC
    • 5.4.2, 5.5.0
    • Tools: Linguist
    • None
    • 69984af8d5465feb9532823f112f322d5404cc15

    Description

      When the condition for a ternary operator contains a period, translator comments are not used. Given the example below the produced XML lists the comment for the second condition and not the first. The expected behaviour would be that both translator comments end up in the output.

      void test()
      { 
        const auto var =
          obj.condition?
          //: Insert comment here
          QObject::tr("success AAA") :
          QObject::tr("failure AAA");
      
        const auto var2 =
          condition?
          //: Insert comment here
          QObject::tr("success BBB") :
          QObject::tr("failure BBB");
      }
      

      TS output:

      <?xml version="1.0" encoding="utf-8"?>
      <!DOCTYPE TS>
      <TS version="2.1">
      <context>
          <name>QObject</name>
          <message>
              <source>success AAA</source>
              <translation type="unfinished"></translation>
          </message>
          <message>
              <source>failure AAA</source>
              <translation type="unfinished"></translation>
          </message>
          <message>
              <source>success BBB</source>
              <extracomment>Insert comment here</extracomment>
              <translation type="unfinished"></translation>
          </message>
          <message>
              <source>failure BBB</source>
              <translation type="unfinished"></translation>
          </message>
      </context>
      </TS>
      

      Attachments

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

        Activity

          People

            hansmi M. Hanselmann
            hansmi M. Hanselmann
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes