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

Make lupdate find context from QObject::tr in a wrapper function

    XMLWordPrintable

Details

    Description

      Currently if a QObject::tr is wrapped in a function lupdate will report "tr() cannot be called without context".

      Suggestion: Make lupdate recognize the context from the wrapper function.

      Example:

      /*The inline tr() function sets up the string inside for translation. This is a shorter representation for of the static member QObject::tr () for use outside of a QObject derived class or C-style function. */ 
      
      inline QString tr(const char* sourceText, const char* disambiguation = nullptr, int n = -1)
      {
          return QObject::tr (sourceText, disambiguation, n);
      }
      

       

      Attachments

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

        Activity

          People

            kkohne Kai Köhne
            miikapernu Miika Pernu
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes