#!/bin/sh # Created by Ryan Boren # Later code and patches from # Kimmo Suominen (more) and Nikolay Bachiyski (less) TEMPLATE=bbpress.pot cwd=`pwd` cd "$1" || exit 1 cp /dev/null "$cwd/$TEMPLATE" find . -name '*.php' -print \ | sed -e 's,^\./,,' \ | sort \ | xargs xgettext \ --keyword=__ \ --keyword=_e \ --keyword=_c \ --keyword=__ngettext:1,2 \ --default-domain=bbpress \ --language=php \ --output="$cwd/$TEMPLATE" \ --join-existing \ --from-code utf-8 \ --copyright-holder=bbPress \ --msgid-bugs-address=wp-polyglots@lists.automattic.com cd "$cwd" sed -i -e '1s/^# SOME DESCRIPTIVE TITLE/# bbPress POT file/' "$TEMPLATE" # sub only the YEAR in the copyright message (the 2nd line) sed -i -e '2s/YEAR/'`date +%Y`'/' "$TEMPLATE" sed -i -e 's/\(^#.*\)PACKAGE\(.*\)/\1bbPress\2/g' "$TEMPLATE" VERSION=`perl -n -e "if (\\\$got) { /return '(.*?)'/; print \\\$1; exit(0); }; \\\$got=1 if /case 'version' :/; " $1/bb-includes/functions.php` sed -i -e "s/\(Project-Id-Version: \)PACKAGE VERSION/\1bbPress $VERSION/" "$TEMPLATE"