Skip to content

Instantly share code, notes, and snippets.

@mrpollo
Created September 27, 2011 05:11
Show Gist options
  • Select an option

  • Save mrpollo/1244384 to your computer and use it in GitHub Desktop.

Select an option

Save mrpollo/1244384 to your computer and use it in GitHub Desktop.
A basic bash script to generate a po file from a project directory, it will recursively find inside it i added some exclusions to remove some framework libraries
#!/bin/bash
for FILENAME in `/usr/bin/find $1 -iname "*.php" | /usr/bin/grep -v -w "Zend\|dompdf\|includes/font\|ZendFramework\|json\|phpmailer"`
do
echo $FILENAME
`/usr/local/bin/xgettext -o lib_amce/langs/en_US/LC_MESSAGES/messages.po --join-existing --from-code=utf-8 --keyword=translate --keyword -L Python $FILENAME`
done
exit;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment