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

lupdate parses commented-out default values as an ID, and merges tr() calls wrongly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Not Evaluated Not Evaluated
    • None
    • 4.6.3, 4.7.0
    • Tools: Linguist
    • None
    • Linux, Windows, Mac.

      Dialog1::Dialog1( QWidget* parent /= 0/ )
      is parsed by lupdate as being an identifier for the next tr() call, which was definitely not the intent of this code.
      As a result, it merges tr() calls wrongly, and some strings get wrongly translated.
      See attached testcase.

      I think the tr id should be discarded upon encountering the ')'. And/or maybe C-style comments shouldn't be used for this magic, since only C++ style comments are documented as having this effect?

        1. dialogs.cpp
          0.4 kB
        2. discard_id.diff
          0.7 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            buddenha Oswald Buddenhagen
            dfaure David Faure (Private)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes