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>
This commit is contained in:
parent
c73aceb168
commit
ec79d9318d
1 changed files with 6 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue