diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2012-04-06 09:44:46 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2012-04-06 09:44:46 +0000 |
commit | 0231c256554f51267bf82c34f142da5f341c6833 (patch) | |
tree | c1e97f6c31e4cbb856117a11163d9c78b02ef2fc /build/i18n-init.sh | |
parent | ec79d9318d3693f5f3664c96251b630984742285 (diff) |
build/i18n-init.sh: add git support
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Diffstat (limited to 'build/i18n-init.sh')
-rwxr-xr-x | build/i18n-init.sh | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/build/i18n-init.sh b/build/i18n-init.sh index 9612068c9..9a206bb2a 100755 --- a/build/i18n-init.sh +++ b/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 |