[SCM] Kingston update notifier (update-notifier-kde) branch, master, updated. 723a1615b9ee75321e6f03961af561bf620700eb
Pino Toscano
pino-guest at alioth.debian.org
Wed May 12 21:20:02 UTC 2010
The following commit has been merged in the master branch:
commit 723a1615b9ee75321e6f03961af561bf620700eb
Author: Pino Toscano <pino at kde.org>
Date: Wed May 12 23:17:44 2010 +0200
add proper infrastructure for extracting messages for translation
Messages.sh is the small script which does the extraction job;
extract-messages.sh is an helper script which sets up the correct variables and executables for the job (as done by KDE's Scripty)
---
Messages.sh | 2 +
extract-messages.sh | 52 +++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 54 insertions(+), 0 deletions(-)
diff --git a/Messages.sh b/Messages.sh
new file mode 100755
index 0000000..538a3ac
--- /dev/null
+++ b/Messages.sh
@@ -0,0 +1,2 @@
+#!/bin/sh
+$XGETTEXT `find src -name \*.cpp | grep -v testapp | grep -v test_window` -o $podir/kingston_update_notifier.pot
diff --git a/extract-messages.sh b/extract-messages.sh
new file mode 100755
index 0000000..e1ed2f5
--- /dev/null
+++ b/extract-messages.sh
@@ -0,0 +1,52 @@
+#! /bin/bash
+
+podir=${podir:-$PWD/po}
+files=`find . -name Messages.sh`
+dirs=`for i in $files; do echo \`dirname $i\`; done | sort -u`
+tmpname="$PWD/messages.log"
+EXTRACTRC=${EXTRACTRC:-extractrc}
+EXTRACTATTR=${EXTRACTATTR:-extractattr}
+PREPARETIPS=${PREPARETIPS:-preparetips}
+REPACKPOT=${REPACKPOT:-repack-pot.pl}
+export EXTRACTRC EXTRACTATTR PREPARETIPS REPACKPOT
+IGNORE=${IGNORE:-.svn}
+
+for subdir in $dirs; do
+ # skip Messages.sh files of KDevelop's app templates
+ grep '{APPNAMELC}[^ ]*.pot' $subdir/Messages.sh 1>/dev/null && continue
+
+ test -z "$VERBOSE" || echo "Making messages in $subdir"
+ (cd $subdir
+ ls -1 *.rc *.ui *.ui3 *.ui4 *.kcfg 2> /dev/null | xargs --no-run-if-empty $EXTRACTRC > rc.cpp
+ if find . -name \*.c\* -o -name \*.h\* | fgrep -v "$IGNORE" | xargs fgrep -s -q KAboutData ; then
+ echo 'i18nc("NAME OF TRANSLATORS","Your names");' >> rc.cpp
+ echo 'i18nc("EMAIL OF TRANSLATORS","Your emails");' >> rc.cpp
+ fi
+
+ # using xgettext 0.15 or later
+ ### TODO what --flags param should be used?
+ XGETTEXT_FLAGS_QT="--from-code=UTF-8 -C --qt -ktr:1,1t -ktr:1,2c,2t -kQT_TRANSLATE_NOOP:1c,2,2t -kQT_TR_NOOP:1,1t -ktranslate:1c,2,2t -ktranslate:2,3c,3t"
+ XGETTEXT_FLAGS="--copyright-holder=This_file_is_part_of_KDE --from-code=UTF-8 -C --kde -ci18n -ki18n:1 -ki18nc:1c,2 -ki18np:1,2 -ki18ncp:1c,2,3 -ktr2i18n:1 -kI18N_NOOP:1 -kI18N_NOOP2:1c,2 -kaliasLocale -kki18n:1 -kki18nc:1c,2 -kki18np:1,2 -kki18ncp:1c,2,3 --msgid-bugs-address=http://bugs.kde.org"
+ export XGETTEXT_FLAGS
+ export XGETTEXT_FLAGS_QT
+
+ if test -f Messages.sh; then
+ # Note: Messages.sh is supposed to get the translators' placeholder by rc.cpp
+ podir=$podir srcdir=. XGETTEXT_PROGRAM="${XGETTEXT:-xgettext}" XGETTEXT_QT="${XGETTEXT:-xgettext} $XGETTEXT_FLAGS_QT" XGETTEXT="${XGETTEXT:-xgettext} $XGETTEXT_FLAGS" bash Messages.sh
+ fi
+ exit_code=$?
+ if test "$exit_code" -ne 0; then
+ echo "Bash exit code: $exit_code"
+ else
+ rm -f rc.cpp
+ fi
+ ) >& $tmpname
+ test -s $tmpname && { echo $subdir ; cat "$tmpname"; }
+done
+
+# # Repack extracted templates.
+# for potfile in $podir/*.pot; do
+# $REPACKPOT $potfile
+# done
+
+rm -f $tmpname
--
Kingston update notifier (update-notifier-kde)
More information about the pkg-kde-commits
mailing list