From d3d45b6755c6a8614cbc4c74cda69ecb1274918a Mon Sep 17 00:00:00 2001 From: pjrm Date: Fri, 23 May 2008 13:38:30 +0000 Subject: [PATCH] =?utf8?q?generate=5FPOTFILES.sh:=20Include=20files=20that?= =?utf8?q?=20use=20*gettext=20functions;=20exclude=20files=20that=20contai?= =?utf8?q?n=20the=20string=20=E2=80=98=5F(=E2=80=99=20when=20it's=20merely?= =?utf8?q?=20part=20of=20the=20string=20=E2=80=98a=5F(=E2=80=99=20etc.=20(?= =?utf8?q?but=20allow=20N=5F,=20Q=5F,=20C=5F).=20Search=20share/extensions?= =?utf8?q?/*.py=20now=20too,=20now=20that=20they=20use=20gettext.=20More?= =?utf8?q?=20consistent=20sorting.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- generate_POTFILES.sh | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/generate_POTFILES.sh b/generate_POTFILES.sh index a345d0e41..adbc667f4 100755 --- a/generate_POTFILES.sh +++ b/generate_POTFILES.sh @@ -1,15 +1,30 @@ -#!/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." -- 2.30.2