Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Exclude directories from lupdate
Qt 6.11 is out! See what's new in the release blog

Exclude directories from lupdate

Scheduled Pinned Locked Moved General and Desktop
6 Posts 5 Posters 3.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mbohlaender
    wrote on last edited by mbohlaender
    #1

    Hello together!

    Hopefully this is the correct section here.

    Is there a way to exclude directories with lupdate? We have a bunch of directories which we don't need to check for translatable strings. At least we want to exclude the "lib/external" directory, because we definetly don't want to translate (or check for translatable strings) in external libraries :-)

    Our command:

    • lupdate -locations relative -recursive . -extensions php -ts lang/backend_de.ts

    Thanks!

    1 Reply Last reply
    0
    • H Offline
      H Offline
      Harism
      wrote on last edited by
      #2

      This is a long shot as I'm not too familiar with lupdate .

      Yet, option -no-recursive could provide you means to skip certain directories.

      -no-recursive
             Do not recursively scan the following directories.
      

      Says the lupdate -help .

      1 Reply Last reply
      1
      • M Offline
        M Offline
        mbohlaender
        wrote on last edited by
        #3

        Mmh, yes I already tried it with:

        • lupdate -locations relative -recursive . -no-recursive ./lib/external/ -extensions php -ts lang/backend_de.ts

        But it didn't really work...

        D Pradeep P NP 2 Replies Last reply
        0
        • M mbohlaender

          Mmh, yes I already tried it with:

          • lupdate -locations relative -recursive . -no-recursive ./lib/external/ -extensions php -ts lang/backend_de.ts

          But it didn't really work...

          D Offline
          D Offline
          DrumM8
          wrote on last edited by
          #4

          @mbohlaender Did you find any solution? Did it work with the absolute path?

          1 Reply Last reply
          0
          • M mbohlaender

            Mmh, yes I already tried it with:

            • lupdate -locations relative -recursive . -no-recursive ./lib/external/ -extensions php -ts lang/backend_de.ts

            But it didn't really work...

            Pradeep P NP Offline
            Pradeep P NP Offline
            Pradeep P N
            wrote on last edited by
            #5

            @mbohlaender
            Please try below code in your .pro file

            Provide required files in lupdate_only { }

            lupdate_only {
            SOURCES += // Please provide files which you want translate. 
                      qml/ * .qml \
                      qml/ * / * .qml \
                      qml/ * / * / * .qml \
                      qml/ * / * / * / *.qml \
                      qml/ * / * / * / *  / *.qml
            
            }
            

            Pradeep Nimbalkar.
            Upvote the answer(s) that helped you to solve the issue...
            Keep code clean.

            1 Reply Last reply
            2
            • D Offline
              D Offline
              dimon4eg
              wrote on last edited by
              #6

              lupdate_only solution does not work for me.
              lst-file works for me:
              create file with name lst-file and inside specify files/folders with sources e.g.:

              sources
              includes
              

              then call lupdate

              lupdate . @lst-file -no-obsolete -ts myapp.ts
              
              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved