summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2015-04-20 10:17:23 +0200
committerJo-Philipp Wich <jow@openwrt.org>2015-04-20 10:17:23 +0200
commit5fd8761583bb3f6a6339ffaa6a8305a6d74fbc7f (patch)
tree6a3fca5d5d86aea904afe08fbe1d57efc268a2e6
parent661c33ba914606ae20afb8489818f0f180ae02d1 (diff)
build: rework i18n-sync.sh to support new structure
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
-rwxr-xr-xbuild/i18n-sync.sh33
1 files changed, 13 insertions, 20 deletions
diff --git a/build/i18n-sync.sh b/build/i18n-sync.sh
index 430e13f28..d4f966658 100755
--- a/build/i18n-sync.sh
+++ b/build/i18n-sync.sh
@@ -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)"
+[ -d ./build ] || {
+ echo "Execute as ./build/i18n-sync.sh" >&2
+ exit 1
+}
- case "$t" in
- *\ *)
- echo "WARNING: Cannot handle $p" >&2
- continue
- ;;
- *base*)
- continue
- ;;
- esac
+./build/mkbasepot.sh
- if [ -f "po/templates/$t.pot" ]; then
- ./build/i18n-scan.pl "$p" > "po/templates/$t.pot"
- fi
- fi
-done
+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/mkbasepot.sh
-./build/i18n-update.pl po
+./build/i18n-update.pl