summaryrefslogtreecommitdiff
path: root/scripts/addLanguage.sh
authormickeyl <mickeyl>2005-06-02 21:44:41 (UTC)
committer mickeyl <mickeyl>2005-06-02 21:44:41 (UTC)
commitd0f6a0721d7ab67a115d08990143944ee71d54ba (patch) (side-by-side diff)
treeba22ad18027419a6417f3d6439a2faf67917ab74 /scripts/addLanguage.sh
parentf55a56f54de1d3fa9084160159a379079a317d96 (diff)
downloadopie-d0f6a0721d7ab67a115d08990143944ee71d54ba.zip
opie-d0f6a0721d7ab67a115d08990143944ee71d54ba.tar.gz
opie-d0f6a0721d7ab67a115d08990143944ee71d54ba.tar.bz2
- move addLanguage.sh and mkipks to scripts/ directory
- finish recursive directory locks and mention in ChangeLog beginning with `CVS:' are removed automatically CVS: CVS: Committing in . CVS: CVS: Modified Files: CVS: ChangeLog libopie2/opiecore/linux/ofilenotify.cpp CVS: libopie2/opiecore/linux/ofilenotify.h CVS: examples/opiecore/onotifytest/main.cpp CVS: examples/opiecore/onotifytest/main.h CVS: Added Files: CVS: scripts/addLanguage.sh scripts/mkipks CVS: ----------------------------------------------------------------------
Diffstat (limited to 'scripts/addLanguage.sh') (more/less context) (ignore whitespace changes)
-rwxr-xr-xscripts/addLanguage.sh33
1 files changed, 33 insertions, 0 deletions
diff --git a/scripts/addLanguage.sh b/scripts/addLanguage.sh
new file mode 100755
index 0000000..e321804
--- a/dev/null
+++ b/scripts/addLanguage.sh
@@ -0,0 +1,33 @@
+#!/bin/bash
+
+# (c) 2002 Bruno Rodrigues <bruno.rodrigues@litux.org>
+# Under GPL Licence
+
+# Add a new TRANSLATION line to every .pro file if there
+# is already at least one TRANSLATION file and this LANG
+# is not present
+# The perl line would grab a TRANSLATION = something and
+# duplicate it to TRANSLATION += .../LANG/...
+
+LANG=$1
+
+if [ "$1x" == "x" ] ; then
+ echo "Usage: $0 <LANG>"
+ exit
+fi
+
+for i in `find . -name "*.pro"` ; do
+ grep TRANSLATIONS $i > /dev/null
+ if [ "$?" != 0 ] ; then
+ echo "$i: No Translations"
+ else
+ grep "../i18n/$LANG/" $i > /dev/null
+ if [ "$?" == 0 ] ; then
+ echo "$i: $LANG already there"
+ else
+ echo "$i: Adding $LANG"
+ perl -p -i.bak -e 's/^(TRANSLATIONS\s*\+?=\s*)(.+?i18n\/)(.+?)(\/.+?\.ts)(.*)$/$1$2$3$4 \\\n\t $2'$LANG'$4$5/' $i
+ fi
+ fi
+done
+