summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRalf Stephan <ralf@ark.in-berlin.de>2006-05-23 14:48:28 +0000
committerrwst <rwst@users.sourceforge.net>2006-05-23 14:48:28 +0000
commite76112849a1276ec85ce3a9d3622e6d1cc7b9848 (patch)
tree9383e548cdef44c7c88416d4f7793b006e8838a2
parentMissed the date (diff)
downloadinkscape-e76112849a1276ec85ce3a9d3622e6d1cc7b9848.tar.gz
inkscape-e76112849a1276ec85ce3a9d3622e6d1cc7b9848.zip
add script to generate .pot file, needed by distcheck
(bzr r979)
-rw-r--r--Makefile.am1
-rw-r--r--po/update_po_files.sh40
2 files changed, 41 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am
index 0cee8933b..8e3f85051 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -137,6 +137,7 @@ EXTRA_DIST = \
packaging/win32/header.bmp \
po/Makefile.mingw \
po/inkscape.pot \
+ po/update_po_files.sh \
src/Makefile.mingw src/inkscape_version.h.mingw src/inkscape.rc src/makedef.pl \
src/helper/sp-marshal.h.mingw src/helper/sp-marshal.cpp.mingw
diff --git a/po/update_po_files.sh b/po/update_po_files.sh
new file mode 100644
index 000000000..0e570d5a1
--- /dev/null
+++ b/po/update_po_files.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+# Updates PO files from the current POT file
+# Please run this program from the po/ directory
+# Existing po.old files will be overwritten
+
+type -p intltool-update >/dev/null 2>/dev/null
+if [ "$?" -eq "0" ]; then
+ intltool-update --pot >/dev/null 2>&1
+ POT_FILENAME="`ls -1rt *.pot 2>/dev/null|tail -1 2>/dev/null`"
+ if [ ! -r "$POT_FILENAME" ]; then
+ echo "Could not create POT file. Exiting."
+ exit
+ fi
+else
+ echo "Could not create POT file (intltool-update not found). Exiting."
+ exit
+fi
+
+PO_FILE_COUNT=0
+
+find . -noleaf -type f -name "*.po"|sort|\
+(
+while read FILENAME; do
+ PO_FILE_COUNT=`expr $PO_FILE_COUNT + 1`
+ mv -f "$FILENAME" "$FILENAME".old # do not ask questions, because the answers would come from the pipe
+ if [ "$?" -eq "0" ]; then
+ echo "$FILENAME"
+ msgmerge "$FILENAME".old "$POT_FILENAME" > "$FILENAME"
+ if [ "$?" -ne "0" ]; then
+ echo "Could not merge \"$FILENAME.old\"."
+ fi
+ else
+ echo "Could not rename \"$FILENAME\". File skipped."
+ fi
+done
+
+echo; echo "Total number of PO files: $PO_FILE_COUNT"
+)
+
+echo