TT#29620 Update script/extract_i18n.sh to modern Sipwise shell policy

Also simplify the script

Change-Id: Ib2e0bbfeccd2160011c5e1a3afb26eee29704cd3
changes/82/21282/9
Alexander Lutay 8 years ago
parent 63d6adbe3e
commit de34aaa9f2

@ -2,39 +2,35 @@
set -e
I18_DIRS="lib/NGCP/Panel/Role \
lib/NGCP/Panel/Field \
lib/NGCP/Panel/AuthenticationStore \
lib/NGCP/Panel/Form \
lib/NGCP/Panel/Render \
lib/NGCP/Panel/Controller \
lib/NGCP/Panel/Model \
lib/NGCP/Panel/Utils \
lib/NGCP/Panel/Widget \
lib/NGCP/Panel/View \
lib/NGCP/Panel/Cache \
share/templates \
share/layout"
declare -a I18_DIRS=()
I18_DIRS+=("lib/NGCP/Panel/Role")
I18_DIRS+=("lib/NGCP/Panel/Field")
I18_DIRS+=("lib/NGCP/Panel/AuthenticationStore")
I18_DIRS+=("lib/NGCP/Panel/Form")
I18_DIRS+=("lib/NGCP/Panel/Render")
I18_DIRS+=("lib/NGCP/Panel/Controller")
I18_DIRS+=("lib/NGCP/Panel/Model")
I18_DIRS+=("lib/NGCP/Panel/Utils")
I18_DIRS+=("lib/NGCP/Panel/Widget")
I18_DIRS+=("lib/NGCP/Panel/View")
I18_DIRS+=("lib/NGCP/Panel/Cache")
I18_DIRS+=("share/templates")
I18_DIRS+=("share/layout")
POT="lib/NGCP/Panel/I18N/messages.pot"
DIRS=""
for d in ${I18_DIRS}; do
DIRS="$DIRS --directory $d"
done
echo; echo "Dumping DB and Form strings"; echo
perl -I../sipwise-base/lib -I../ngcp-schema/lib -Ilib script/ngcp_panel_dump_db_strings.pl
echo; echo "Creating $POT"; echo
echo; echo "Creating ${POT}"; echo
xgettext.pl \
--output=$POT \
$DIRS \
-P perl=tt,pm
--output="${POT}" \
"${I18_DIRS[@]/#/--directory=}" \
-P perl=tt,pm
while IFS= read -r -d '' po ; do
echo; echo "Merging $po"; echo
msgmerge --no-fuzzy-matching --add-location=file --update "$po" "$POT"
echo; echo "Merging ${po}"; echo
msgmerge --no-fuzzy-matching --add-location=file --update "${po}" "${POT}"
done < <(find lib/NGCP/Panel/I18N -name "*.po" -print0)
echo; echo "Removing line numbers"; echo

Loading…
Cancel
Save