build: i18n-scan.pl: add support for ucode sources and templates
[project/luci.git] / build / i18n-sync.sh
1 #!/bin/sh
2
3 [ -d ./build ] || {
4 echo "Execute as ./build/i18n-sync.sh" >&2
5 exit 1
6 }
7
8 [ -n "$1" ] || ./build/mkbasepot.sh
9
10 find "${1:-.}" -name '*.pot' -and -not -name base.pot | \
11 while read path; do
12 dir="${path%/po/templates/*}"
13 echo -n "Updating ${path#./} ... "
14 ./build/i18n-scan.pl "$dir" > "$path"
15 echo "done"
16 done
17
18 if [ -n "$1" ]; then
19 find "$1" -path '*/templates/*.pot' -printf '%h ' | \
20 xargs -r -n 1 dirname | \
21 xargs -r -n 1 ./build/i18n-update.pl
22 else
23 ./build/i18n-update.pl
24 fi