libs/web: rework luci.sauth
[project/luci.git] / build / i18n-init.sh
1 #!/bin/sh
2
3 PATTERN=$1
4 SCM=
5
6 [ -d .svn ] && SCM="svn"
7 [ -d .git ] && SCM="git"
8
9 [ -z "$SCM" ] && {
10         echo "Unsupported SCM tool" >&2
11         exit 1
12 }
13
14 [ -z "$PATTERN" ] && PATTERN="*.pot"
15
16 for lang in $(cd po; echo ?? ??_??); do
17         for file in $(cd po/templates; echo $PATTERN); do
18                 if [ -f po/templates/$file -a ! -f "po/$lang/${file%.pot}.po" ]; then
19                         msginit --no-translator -l "$lang" -i "po/templates/$file" -o "po/$lang/${file%.pot}.po"
20                         $SCM add "po/$lang/${file%.pot}.po"
21                 fi
22         done
23 done