projects
/
project
/
luci.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
libs/datatypes: Fix typo
[project/luci.git]
/
build
/
i18n-init.sh
diff --git
a/build/i18n-init.sh
b/build/i18n-init.sh
index
72199bb
..
9a206bb
100755
(executable)
--- a/
build/i18n-init.sh
+++ b/
build/i18n-init.sh
@@
-1,10
+1,23
@@
#!/bin/sh
#!/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 lang in $(cd po; echo ?? ??_??); do
- for file in $(cd po/templates; echo
*.pot
); do
- if [ ! -f "po/$lang/${file%.pot}.po" ]; then
+ 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"
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
fi
done
done