X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=build%2Fi18n-sync.sh;h=d4f966658565ab1bdc5acdbf7858595ab338df52;hp=137852bb63ad4572d9bc5024bf052ba77c3fd6de;hb=0bfe064cc3f6c17cae6035d4a87066cdb6464078;hpb=3944cdaac4d145b67668da055c15b931fd117e80;ds=sidebyside diff --git a/build/i18n-sync.sh b/build/i18n-sync.sh index 137852bb6..d4f966658 100755 --- a/build/i18n-sync.sh +++ b/build/i18n-sync.sh @@ -1,24 +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/i18n-update.pl po +./build/i18n-update.pl