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

translator comments not found by lupdate

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 4.8.x, 5.10.1
    • Tools: Linguist

    Description

      Translator comment is not found by lupdate in common cases:
       

      void foo::init( testType type )
      {
        QString result;
      
        //: Default type None
        result = tr( "None" );
        
        if ( type == TEST_START )
          //: Starting Time
          result = tr( "Start" );
      }
      

       
      extracoment for "Start" is missing in the resulting TS file:

      <?xml version="1.0" encoding="utf-8"?>
      <!DOCTYPE TS>
      <TS version="2.1">
      <context>
        <name>foo</name>
        <message>
          <location filename="foo1.cpp" line="10"/>
          <source>None</source>
          <extracomment>Default type None</extracomment>
          <translation type="unfinished"></translation>
        </message>
        <message>
          <location filename="foo1.cpp" line="14"/>
          <source>Start</source>
          <translation type="unfinished"></translation>
        </message>
      </context>
      </TS>
      

      In a similar case

      void foo::init( testType type )
      {
        QString result;
      
        if ( type == TEST_START )
          //: Starting Time
          result = tr( "Start" );
        else if ( type == TEST_END )
          //: Ending Time
          result = tr( "End" );
        else
          //: Default type None
          result = tr( "None" );
      }
      

      the resulting TS file only provides one extracomment:

      <?xml version="1.0" encoding="utf-8"?>
      <!DOCTYPE TS>
      <TS version="2.1">
      <context>
        <name>foo</name>
        <message>
          <location filename="foo1.cpp" line="11"/>
          <source>Start</source>
          <translation type="unfinished"></translation>
        </message>
        <message>
          <location filename="foo1.cpp" line="14"/>
          <source>End</source>
          <translation type="unfinished"></translation>
        </message>
        <message>
          <location filename="foo1.cpp" line="17"/>
          <source>None</source>
          <extracomment>Default type None</extracomment>
          <translation type="unfinished"></translation>
        </message>
      </context>
      </TS>
      

      Attachments

        Activity

          People

            kkohne Kai Köhne
            ralfmeier Ralf Meier
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: