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

".pragma library" statement in JavaScript breaks lupdate

    XMLWordPrintable

Details

    • 1d1fbec4a2fcfde4e3e5c20c4ff6b679385773fd

    Description

      We have UI strings in JavaScript library files need localization, but seems lupdate (4.7.1) fails to parse the .js library file - it reports error line number of the line ".pragma library" and skips the rest content.

      For example, running lupdate on loclib.js which has only 3 lines code:

      .pragma library
      function locstring()

      { return qsTr("logicalNameHere"); }

      The output from lupdate is as below and nothing added to loclib.ts.

      C:\Temp>lupdate loclib.js -ts loclib.ts
      C:/Temp/loclib.js:1:
      Updating 'loclib.ts'...
      Found 0 source text(s) (0 new and 0 already existing)

      If comment out ".pragma library" , lupdate will find the qsTr("logicalNameHere").

      Attachments

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

        Activity

          People

            kenthans Kent Hansen (Inactive)
            martjone Martin Jones (closed Nokia identity) (Inactive)
            Votes:
            6 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes