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

lupdate ignores strings if .cpp file includes other .cpp files

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 4.8.6, 5.2.0
    • 4.8.3
    • Tools: Linguist
    • None
    • Windows 7 + Qt4.8.3
    • bcaa8575352ad16e1f6020436e1a3f450eefd53e,31c6cbbe529c6fdbaf259f7ed87547db6dda7842

    Description

      The attached example application demonstrates the use case. Source file
      myclass.cpp includes other .cpp files i.e. myclass1.cpp and myclass2.cpp. All of these .cpp files implement functions for MyClassTest:

      myclass.cpp:

      #include "myclass.h"
      
      MyClassTest::MyClassTest(QObject *parent) :
          QObject(parent)
      {
      }
      
      QString MyClassTest::doTranslate()
      {
          QString test(tr("My test:"));
          return test;
      }
      
      #include "myclass1.cpp"
      #include "myclass2.cpp"
      

      myclass1.cpp:

      #include "myclass.h"
      
      QString MyClassTest::doTranslate1()
      {
          QString test1(tr("My test1:"));
          return test1;
      }
      

      --> when lupdate is run for test.pro the strings on myclass1.cpp and myclass2.cpp are not added to the generated .ts file.
      Note: if .cpp includes are removed from myclass.cpp the lupdate picks up the strings also from myclass1.cpp and myclass2.cpp.

      Attachments

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

        Activity

          People

            buddenha Oswald Buddenhagen
            qtcomsupport Qt Support
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes