Skip to content

Instantly share code, notes, and snippets.

@marklindhout
Created April 1, 2012 11:45
Show Gist options
  • Star 13 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save marklindhout/2274861 to your computer and use it in GitHub Desktop.
Save marklindhout/2274861 to your computer and use it in GitHub Desktop.
Use xgettext to create default.pot from all PHP files in a directory (recursive), and place it in /languages/.
xgettext --from-code=utf-8 -k_e -k_x -k__ -o languages/default.pot $(find . -name "*.php")
@nickyout
Copy link

Does not work for large amount of files: "Argument list too long". This did: http://stackoverflow.com/questions/11451105/recursive-scan-for-files-with-xgettext

Making the line:

find . -iname "*.php" | xargs xgettext --from-code=UTF-8 -k_e -k_x -k__ -o languages/default.pot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment