How to create .pot file from source code

I just learned how to create a .pot from https://wordpress.stackexchange.com/a/169282/33599

Checkout WordPress development branch via SVN which has a script for creating .pot file.

cd /tmp
svn co http://develop.svn.wordpress.org/trunk wordpress-svn
php wordpress-svn/tools/i18n/makepot.php wp-plugin PATH_TO_PLUGIN PATH_TO_PLUGIN/language/PLUGIN_NAME.pot

makepot.php help

Usage: php makepot.php PROJECT DIRECTORY [OUTPUT]

Generate POT file from the files in DIRECTORY [OUTPUT]
Available projects: generic, wp-frontend, wp-admin, wp-network-admin, wp-tz, wp-plugin, wp-theme, glotpress, rosetta, wporg-bb-forums, wporg-themes, wporg-plugins, wporg-forums, wordcamporg
Advertisements