Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

executable file 56 lines (46 sloc) 1.621 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
#!/bin/sh

# FIXME keeping the old xgettext instance as it contains some useful setting/config info
# that isn't in the new Djangofied POT builder
#
#basedir=..
#
#xgettext \
#--add-comments=l10n \
#--package-name=Pootle \
#--package-version=`egrep "^ver" ../pootle_app/__version__.py | sed "s,.*(\(.*\)),\1,g" | sed "s,[ ],,g"` \
#--language=Python \
#--keyword=localize \
#--keyword=nlocalize:1,2 \
#--default-domain=pootle \
#--msgid-bugs-address=translate-pootle@lists.sourceforge.net \
#--copyright-holder="Zuza Software Foundation (Translate.org.za)" \
#-o $basedir/po/pootle/templates/pootle.pot \
#`find ../ -name "*.py" | sort`

basedir=`dirname $0`/..
verbosity=0

# Placeholders
YEAR_COPYRIGHT_PLACEHOLDER="YEAR THE PACKAGE'S COPYRIGHT HOLDER"
PACKAGE_VERSION_PLACEHOLDER="PACKAGE VERSION"

# Filename constants
DJANGO_POT="locale/pot/LC_MESSAGES/django.po"
DJANGO_JS_POT="locale/pot/LC_MESSAGES/djangojs.po"
POOTLE_POT="po/pootle/templates/pootle.pot"
POOTLE_JS_POT="po/pootle/templates/pootle_js.pot"

# Header settings
YEAR=`date +%Y`
COPYRIGHT_HOLDER="Zuza Software Foundation (Translate.org.za)"
PACKAGE="Pootle"
VERSION="2.2"

pushd . 2>&1 > /dev/null
cd $basedir
verbosity="-v $verbosity"
mkdir locale

./manage.py makemessages $verbosity -e ".py" -e ".txt" -e ".html" -l pot
./manage.py makemessages $verbosity -d djangojs -l pot

# Header replacements
sed -i "s/$YEAR_COPYRIGHT_PLACEHOLDER/$YEAR $COPYRIGHT_HOLDER/" $DJANGO_POT
sed -i "s/$PACKAGE_VERSION_PLACEHOLDER/$PACKAGE $VERSION/" $DJANGO_POT

mv $DJANGO_POT $POOTLE_POT
mv $DJANGO_JS_POT $POOTLE_JS_POT

rm -rf locale
popd 2>&1 > /dev/null
Something went wrong with that request. Please try again.