- Install Homebrew:
Install Homebrew : /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
- Install GNU gettext:
brew install gettext
- Then you must add that package to your path:
echo 'export PATH="/usr/local/opt/gettext/bin:$PATH"' >> ~/.bash_profile
- Restart your computer! (Otherwise you will get "sh: msguniq: command not found" error).
svn co http://develop.svn.wordpress.org/trunk/ wpdev
This will create folder called "wpdev" under your user folder and has all the needed WP i18n tools files.
In the terminal change the directory to i18n tools directory
cd wpdev/tools/i18n/
- For themes:
php makepot.php wp-theme /path/to/your/theme/folder/ themename.pot
- For plugins:
php makepot.php wp-plugin /path/to/your/plugin/folder/ pluginname.pot
The new .pot
file is created and be found inside the wpdev/tools/i18n/
directory. Just copy and paste it inside the languages folder of your theme or plugin.