summaryrefslogtreecommitdiffhomepage
path: root/build
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2012-04-06 09:44:43 +0000
committerJo-Philipp Wich <jow@openwrt.org>2012-04-06 09:44:43 +0000
commitec79d9318d3693f5f3664c96251b630984742285 (patch)
tree84cfafaffe365344b104510efd70a2f3de3f36bc /build
parentc73aceb168c7be349b2dbabbfd864467e06d2b1d (diff)
build/i18n-init.sh: allow to use custom pattern for template files
This allows to initialize language files for individual modules. Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Diffstat (limited to 'build')
-rwxr-xr-xbuild/i18n-init.sh8
1 files changed, 6 insertions, 2 deletions
diff --git a/build/i18n-init.sh b/build/i18n-init.sh
index 72199bb38..9612068c9 100755
--- a/build/i18n-init.sh
+++ b/build/i18n-init.sh
@@ -1,8 +1,12 @@
#!/bin/sh
+PATTERN=$1
+
+[ -z "$PATTERN" ] && PATTERN='*.pot'
+
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"
svn add "po/$lang/${file%.pot}.po"
fi