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

lupdate generates errors for tr() marked strings in template specializations

    XMLWordPrintable

Details

    Description

      lupdate fails with "tr() cannot be called without context" error or assigns incorrect translation context for translatable strings marked with QObject::tr() when the template functions definitions for the template specialization are located in the source file instead of the header file.

      lupdate correctly generates the ts file and the errors do not occur when QCoreApplication::translate() is used.

      Attached example reproduces the issue.

      Attachments

        1. Helper.cpp
          0.8 kB
        2. Helper.h
          0.4 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kkohne Kai Köhne
            lysandra.sola Lysandra Sola
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes