Sync paths in POT files with CI scripts

The infra scripts which handle translation support for horizon
was recently changed to remove horizon special handling.
As a result, file paths in POT files now contains module names
(openstack_dashboard or horizon).

This commit update pybabel related functions in run_tests.sh
so that even when we run ./run_tests.sh --makemessages in
local env POT files are not changed unexpectedly.

Change-Id: I32e83244e7fa3a4f6039573a97f1b0dca9fdd4c8
This commit is contained in:
Akihiro Motoki 2016-02-24 19:56:49 +09:00 committed by Andreas Jaeger
parent 16660b07da
commit b903a380b5

View File

@ -434,36 +434,35 @@ function run_integration_tests {
}
function babel_extract {
DOMAIN=$1
KEYWORDS="-k gettext_noop -k gettext_lazy -k ngettext_lazy:1,2"
local MODULE_NAME=$1
local DOMAIN=$2
local KEYWORDS="-k gettext_noop -k gettext_lazy -k ngettext_lazy:1,2"
KEYWORDS+=" -k ugettext_noop -k ugettext_lazy -k ungettext_lazy:1,2"
KEYWORDS+=" -k npgettext:1c,2,3 -k pgettext_lazy:1c,2 -k npgettext_lazy:1c,2,3"
${command_wrapper} pybabel extract -F ../babel-${DOMAIN}.cfg \
--add-comments Translators: -o locale/${DOMAIN}.pot $KEYWORDS .
${command_wrapper} pybabel extract -F babel-${DOMAIN}.cfg \
--add-comments Translators: -o $MODULE_NAME/locale/${DOMAIN}.pot \
$KEYWORDS $MODULE_NAME
}
function run_makemessages {
echo -n "horizon: "
cd horizon
babel_extract django
babel_extract horizon django
HORIZON_PY_RESULT=$?
echo -n "horizon javascript: "
babel_extract djangojs
babel_extract horizon djangojs
HORIZON_JS_RESULT=$?
echo -n "openstack_dashboard: "
cd ../openstack_dashboard
babel_extract django
babel_extract openstack_dashboard django
DASHBOARD_RESULT=$?
echo -n "openstack_dashboard javascript: "
babel_extract djangojs
babel_extract openstack_dashboard djangojs
DASHBOARD_JS_RESULT=$?
cd ..
if [ $check_only -eq 1 ]; then
git checkout -- horizon/locale/django*.pot
git checkout -- openstack_dashboard/locale/django*.pot