Open westonruter opened 9 years ago
Here is a bash script I hacked together yesterday:
##
# Refreshes POMO translations.
##
wp-pot-update () {
if [ -z $1 ]; then
echo 'Usage: wp-pot-update <wordpoints-src>'
return 0
fi
src=`cd "$1"; pwd`
php ~/svn/wordpress/trunk/tools/i18n/makepot.php wp-plugin "$src" "$src/languages/wordpoints.pot"
for f in $(find "$src/languages" -name '*.po' -type f); do
msgmerge --update "$f" "$src/languages/wordpoints.pot"
msgfmt -o "${f%po}mo" "$f"
done
}
It uses the i18n tools packaged with WordPress trunk to generate the POT file, and then updates the po and mo files. I thought it might be worth sharing here. (Though, of course, it needs to be more generalized.)
:+1: for this feature! It will be so handy to do this on the pre-commit
hook.
I don't think this is relevant anymore with the new reality of translate.wordpress.org
I would do it with Grunt anyhow. This might be relevant for private repos that need transitions though.
It's very relevant for private plugins, as well as free plugins alike that already have PO files and elect not to crowdsource the translations.
OK :smile:
See also https://github.com/wp-cli/wp-cli/issues/1042