luci/build/i18n-init.sh
Jo-Philipp Wich 0231c25655 build/i18n-init.sh: add git support
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
2012-04-06 09:44:46 +00:00

23 lines
490 B
Bash
Executable file

#!/bin/sh
PATTERN=$1
SCM=
[ -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"
$SCM add "po/$lang/${file%.pot}.po"
fi
done
done