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%/}"
28 [ -n "$1" ] || .
/build
/mkbasepot.sh
30 # Absent a [folder] parameter, use the current path
31 find "${1:-.}" -name '*.pot' -and -not -name base.pot |
sort | \
32 xargs -P 10 -I{} sh
-c '
33 dir="${1%/po/templates/*}"
34 echo "Updating ${1#./} ... "
35 ./build/i18n-scan.pl "$dir" > "$1"
40 # dir="${path%/po/templates/*}"
41 # echo "Updating ${path#./} ... "
42 # # Scan for strings in a directory and stash them in the .pot file:
43 # ./build/i18n-scan.pl "$dir" > "$path"
49 if [ "$(uname)" = "Darwin" ] ||
[ "$(uname)" = "FreeBSD" ]; then
50 # macOS-specific commands
51 find "$1" -path '*/templates/*.pot' -print0 |
xargs -0r stat
-f '%N' | \
52 xargs -r -n 1 dirname | \
53 xargs -r -n 1 dirname |
sort | \
54 xargs -r -n 1 -P 40 .
/build
/i18n-update.pl
55 elif [ "$(uname)" = "Linux" ]; then
56 # Linux-specific commands
57 find "$1" -path '*/templates/*.pot' -printf '%h ' | \
58 xargs -r -n 1 dirname | \
59 xargs -r -n 1 -P 40 .
/build
/i18n-update.pl
60 # elif [ "$(uname)" = "SunOS" ]; then
61 # # Solaris-specific commands
63 # GNU specific commands can go here:
64 find "$1" -path '*/templates/*.pot' -printf '%h ' | \
65 xargs -r -n 1 dirname | \
66 xargs -r -n 1 -P 40 .
/build
/i18n-update.pl
69 # this performs operations on all .po files
70 .
/build
/i18n-update.pl