build: rework i18n-sync.sh to support new structure
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
This commit is contained in:
parent
661c33ba91
commit
5fd8761583
1 changed files with 14 additions and 21 deletions
|
@ -1,25 +1,18 @@
|
|||
#!/bin/sh
|
||||
|
||||
for m in */*/Makefile; do
|
||||
if grep -qE '^PO *=' $m; then
|
||||
p="${m%/Makefile}"
|
||||
t="$(sed -ne 's/^PO *= *//p' $m)"
|
||||
|
||||
case "$t" in
|
||||
*\ *)
|
||||
echo "WARNING: Cannot handle $p" >&2
|
||||
continue
|
||||
;;
|
||||
*base*)
|
||||
continue
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -f "po/templates/$t.pot" ]; then
|
||||
./build/i18n-scan.pl "$p" > "po/templates/$t.pot"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
[ -d ./build ] || {
|
||||
echo "Execute as ./build/i18n-sync.sh" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
./build/mkbasepot.sh
|
||||
./build/i18n-update.pl po
|
||||
|
||||
find . -name '*.pot' -and -not -name base.pot -and -not -name rrdtool.pot | \
|
||||
while read path; do
|
||||
dir="${path%/po/templates/*}"
|
||||
echo -n "Updating ${path#./} ... "
|
||||
./build/i18n-scan.pl "$dir" > "$path"
|
||||
echo "done"
|
||||
done
|
||||
|
||||
./build/i18n-update.pl
|
||||
|
|
Loading…
Reference in a new issue