|
Revision 1279, 1.8 kB
(checked in by fma, 20 months ago)
|
|
Added svn:keywords tag
|
-
Property svn:executable set to
*
-
Property svn:keywords set to
Id
|
| Line | |
|---|
| 1 | #/bin/sh |
|---|
| 2 | # $Id$ |
|---|
| 3 | |
|---|
| 4 | APP_NAME="papywizard" |
|---|
| 5 | TMP_DIR="tmp" |
|---|
| 6 | POT_FILE="$APP_NAME.pot" |
|---|
| 7 | PO_FILE="$APP_NAME.po" |
|---|
| 8 | MO_FILE="$APP_NAME.mo" |
|---|
| 9 | LOCALE_DIR="locale" |
|---|
| 10 | |
|---|
| 11 | mkdir -p $TMP_DIR |
|---|
| 12 | |
|---|
| 13 | # Extract strings from python files |
|---|
| 14 | python_files="`find papywizard -type f -name \"*.py\"`" |
|---|
| 15 | |
|---|
| 16 | echo xgettext --language=Python --from-code=utf-8 --default-domain=$APP_NAME --keyword=_ --no-wrap --output=$TMP_DIR/$APP_NAME $python_files |
|---|
| 17 | xgettext --language=Python --from-code=utf-8 --default-domain=$APP_NAME --keyword=_ --no-wrap --output=$TMP_DIR/$APP_NAME $python_files |
|---|
| 18 | |
|---|
| 19 | # Extract strings from glade files |
|---|
| 20 | glade_files=`ls papywizard/view/*.glade` |
|---|
| 21 | for file in $glade_files; do |
|---|
| 22 | echo intltool-extract -l --type=gettext/glade $file |
|---|
| 23 | intltool-extract -l --type=gettext/glade $file |
|---|
| 24 | done |
|---|
| 25 | |
|---|
| 26 | xgettext --language=Python --from-code=utf-8 --default-domain=$APP_NAME --keyword=_ --keyword=N_ --no-wrap --output=$TMP_DIR/$POT_FILE $python_files $TMP_DIR/*.h |
|---|
| 27 | |
|---|
| 28 | # Generate PO and MO files |
|---|
| 29 | for lang in 'en' 'fr' 'pl' 'de' 'es' 'nl' 'it'; do |
|---|
| 30 | mkdir -p $LOCALE_DIR/$lang/LC_MESSAGES |
|---|
| 31 | if ! [ -e $LOCALE_DIR/$lang/LC_MESSAGES/$PO_FILE ]; then |
|---|
| 32 | echo msginit --input=$TMP_DIR/$POT_FILE --locale=$lang --no-translator --no-wrap --output=$LOCALE_DIR/$lang/LC_MESSAGES/$PO_FILE |
|---|
| 33 | msginit --input=$TMP_DIR/$POT_FILE --locale=$lang --no-translator --no-wrap --output=$LOCALE_DIR/$lang/LC_MESSAGES/$PO_FILE |
|---|
| 34 | fi |
|---|
| 35 | if [ $TMP_DIR/$POT_FILE -nt $LOCALE_DIR/$lang/LC_MESSAGES/$MO_FILE ]; then |
|---|
| 36 | echo msgmerge -U $LOCALE_DIR/$lang/LC_MESSAGES/$PO_FILE $TMP_DIR/$POT_FILE |
|---|
| 37 | msgmerge -U $LOCALE_DIR/$lang/LC_MESSAGES/$PO_FILE $TMP_DIR/$POT_FILE |
|---|
| 38 | echo msgfmt -v --output-file=$LOCALE_DIR/$lang/LC_MESSAGES/$MO_FILE $LOCALE_DIR/$lang/LC_MESSAGES/$PO_FILE |
|---|
| 39 | msgfmt -v --output-file=$LOCALE_DIR/$lang/LC_MESSAGES/$MO_FILE $LOCALE_DIR/$lang/LC_MESSAGES/$PO_FILE |
|---|
| 40 | fi |
|---|
| 41 | done |
|---|