mirror of
https://github.com/coolsnowwolf/luci
synced 2025-01-07 07:06:41 +08:00
25 lines
548 B
Bash
Executable File
25 lines
548 B
Bash
Executable File
#!/bin/sh
|
|
|
|
PATTERN=$1
|
|
SCM=
|
|
|
|
[ -d .svn ] && SCM="svn"
|
|
git=$( which git 2>/dev/null )
|
|
[ "$git" ] && "$git" status >/dev/null && 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
|