d8460fc2b861e89926b9c758d6536d3c734d14fb
4 echo "Execute as ./build/i18n-sync.sh [-b]" >&2
5 echo "Or run as: ./build/i18n-sync.sh [-b] [module folder e.g. applications/luci-app-example]" >&2
7 echo " -b: Generate the base .pot file ( invokes ./build/mkbasepot.sh )"
26 [ -n "$1" ] && set -- "${1%/}"
29 # Absent a [folder] parameter, use the current path
30 find "${1:-.}" -name '*.pot' -and -not -name base.pot |
sort | \
31 xargs -P 10 -I{} sh
-c '
32 dir="${1%/po/templates/*}"
33 echo "Updating ${1#./} ... "
34 ./build/i18n-scan.pl "$dir" > "$1"
39 # dir="${path%/po/templates/*}"
40 # echo "Updating ${path#./} ... "
41 # # Scan for strings in a directory and stash them in the .pot file:
42 # ./build/i18n-scan.pl "$dir" > "$path"
48 if [ "$(uname)" = "Darwin" ] ||
[ "$(uname)" = "FreeBSD" ]; then
49 # macOS-specific commands
50 find "$1" -path '*/templates/*.pot' -print0 |
xargs -0r stat
-f '%N' | \
51 xargs -r -n 1 dirname | \
52 xargs -r -n 1 dirname |
sort | \
53 xargs -r -n 1 -P 40 .
/build
/i18n-update.pl
54 elif [ "$(uname)" = "Linux" ]; then
55 # Linux-specific commands
56 find "$1" -path '*/templates/*.pot' -printf '%h ' | \
57 xargs -r -n 1 dirname | \
58 xargs -r -n 1 -P 40 .
/build
/i18n-update.pl
59 # elif [ "$(uname)" = "SunOS" ]; then
60 # # Solaris-specific commands
62 # GNU specific commands can go here:
63 find "$1" -path '*/templates/*.pot' -printf '%h ' | \
64 xargs -r -n 1 dirname | \
65 xargs -r -n 1 -P 40 .
/build
/i18n-update.pl
68 # this performs operations on all .po files
69 .
/build
/i18n-update.pl