Skip to content
Browse files

build/i18n-init.sh: add git support

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

git-svn-id: http://svn.luci.subsignal.org/luci/trunk@8520 ab181a69-ba2e-0410-a84d-ff88ab4c47bc
  • Loading branch information...
1 parent 69c7f80 commit 3a53c6b25f127a91d3e9dced6cef88b9a011038f jow committed Apr 6, 2012
Showing with 11 additions and 2 deletions.
  1. +11 −2 build/i18n-init.sh
View
13 build/i18n-init.sh
@@ -1,14 +1,23 @@
#!/bin/sh
PATTERN=$1
+SCM=
-[ -z "$PATTERN" ] && PATTERN='*.pot'
+[ -d .svn ] && SCM="svn"
+[ -d .git ] && SCM="git"
+
+[ -z "$SCM" ] && {
+ echo "Unsupported SCM tool" >&2
+ exit 1
+}
+
+[ -z "$PATTERN" ] && PATTERN="*.pot"
for lang in $(cd po; echo ?? ??_??); do
for file in $(cd po/templates; echo $PATTERN); do
if [ -f po/templates/$file -a ! -f "po/$lang/${file%.pot}.po" ]; then
msginit --no-translator -l "$lang" -i "po/templates/$file" -o "po/$lang/${file%.pot}.po"
- svn add "po/$lang/${file%.pot}.po"
+ $SCM add "po/$lang/${file%.pot}.po"
fi
done
done

0 comments on commit 3a53c6b

Please sign in to comment.
Something went wrong with that request. Please try again.