summaryrefslogtreecommitdiffstats
path: root/translate
diff options
context:
space:
mode:
Diffstat (limited to 'translate')
-rw-r--r--translate83
1 files changed, 83 insertions, 0 deletions
diff --git a/translate b/translate
new file mode 100644
index 000000000..0a19b1bf1
--- /dev/null
+++ b/translate
@@ -0,0 +1,83 @@
+#!/bin/sh
+
+# Update this path if necessary
+KDEL10N=$PWD/../kde-l10n
+
+export LC_ALL=C
+export CDPATH=
+
+# Fix up the script
+if ! grep -q Language-Team admin/cvs.sh; then
+ patch admin/cvs.sh < cvs.sh.diff
+fi
+
+test -L po || ( rm -f po ; ln -s ../kde-l10n/templates/messages/kdepim po )
+
+# I tried setting podir to get the output directly into kde-l10n but then
+# we run old code in cvs.sh; scripty doesn't use that anymore, but the scripts in l10n.
+# However those are harder to reduce to kdepim only, so let's keep the old way
+# of doing it: with a po subdir, like a 3rd-party app and not like a real kde module.
+#export podir="$KDEL10N/templates/messages/kdepim"
+if ! test -d "po"; then
+ echo "po doesn't exist"
+ exit 1
+fi
+
+if test -z "$XGETTEXT"; then
+ if test -f /usr/bin/kde-xgettext; then
+ xgettext=kde-xgettext
+ export XGETTEXT=kde-xgettext
+ elif test -f /opt/kde3/bin/kde-xgettext; then
+ xgettext=/opt/kde3/bin/kde-xgettext
+ export XGETTEXT=$xgettext
+ else
+ xgettext=xgettext
+ fi
+else
+ xgettext="$XGETTEXT"
+fi
+gettext_version=`$xgettext --version | grep 0.10.35`
+if test -z "$gettext_version"; then
+ echo "No xgettext installed or wrong xgettext version: "`$xgettext --version | head -n1`
+ exit 1
+fi
+
+kdepim="$PWD"
+
+# I assume kdepim is uptodate, but kde-l10n is probably not
+cd "$KDEL10N" || exit 1
+svn update
+
+cd "$kdepim"
+make -f admin/Makefile.common package-messages || exit 1
+# ? make -f admin/Makefile.common package-merge || exit 1
+
+cd "$KDEL10N" || exit 1
+
+scripts/merge_all.sh
+
+svn diff
+
+for i in `find -name kdepim`; do
+ cd $i || exit 1
+
+ for t in `svn status 2>&1 | grep '^M' | gawk '{print $2}'`; do
+ diff=`diff -u -I'^#' -I'^"POT-Creation-Date:' .svn/text-base/$t.svn-base $t`
+ if test -n "$diff"; then
+ echo "$t: changed"
+ else
+ #echo "$t: no change"
+ svn revert $t
+ fi
+ done
+ # New files are not added automatically; do those by hand.
+
+ # To see what changed in a .pot file: svn di kmail.pot | grep '^[-+][^#]'
+
+ cd "$KDEL10N"
+done
+
+scripts/check_po_files
+
+echo "Now go to $KDEL10N and commit templates/ and de/"
+