summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8bad47b)
raw | patch | inline | side by side (parent: 8bad47b)
author | pjrm <pjrm@users.sourceforge.net> | |
Fri, 23 May 2008 13:38:30 +0000 (13:38 +0000) | ||
committer | pjrm <pjrm@users.sourceforge.net> | |
Fri, 23 May 2008 13:38:30 +0000 (13:38 +0000) |
Search share/extensions/*.py now too, now that they use gettext.
More consistent sorting.
More consistent sorting.
generate_POTFILES.sh | patch | blob | history |
diff --git a/generate_POTFILES.sh b/generate_POTFILES.sh
index a345d0e41a1783b33b533e130cbf0c639ef1afda..adbc667f4062b20fc3a9046614f460329ea4ca80 100755 (executable)
--- a/generate_POTFILES.sh
+++ b/generate_POTFILES.sh
-#!/bin/bash
+#! /bin/sh
+
+set -e
echo "Generating updated POTFILES list..."
+mydir=`dirname "$0"`
+cd "$mydir"
+if [ . = "$mydir" ]; then
+ prog="$0"
+else
+ prog=`basename "$0"`
+fi
+
+rm -f po/POTFILES.in.new
+
+(
+ echo "# List of source files containing translatable strings."
+ echo "# Please keep this file sorted alphabetically."
+ echo "# Generated by $prog at `date`"
+ echo "[encoding: UTF-8]"
+ echo "inkscape.desktop.in"
-echo "# List of source files containing translatable strings.
-# Please keep this file sorted alphabetically.
-# Generated from script by mfx at" `date` "
-[encoding: UTF-8]
-inkscape.desktop.in" >po/POTFILES.in.new
+ find src \( -name '*.cpp' -o -name '*.[ch]' \) -type f -print0 | xargs -0 egrep -l '(\<[QNC]?_|gettext) *\(' | sort
+ find share/extensions -name '*.py' -type f -print0 | xargs -0 egrep -l '(\<[QNC]?_|gettext) *\(' | sort
+ find share/extensions -name '*.inx' -type f -print | sort | sed 's%^%[type: gettext/xml] %'
+) > po/POTFILES.in.new
-grep -r -l -I "_(" src/ | grep -E ".(cpp|c|h)$" | sort >>po/POTFILES.in.new
-find share/extensions -name "*.inx" | sort | xargs -n 1 printf "[type: gettext/xml] %s\n" >>po/POTFILES.in.new
-diff po/POTFILES.in po/POTFILES.in.new -q
+diff -q po/POTFILES.in po/POTFILES.in.new ||:
mv po/POTFILES.in.new po/POTFILES.in
echo "Done."