diff --git a/devstack/plugin.sh b/devstack/plugin.sh index f8f99482..1e24b28f 100644 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -8,15 +8,10 @@ function install_sahara_dashboard { function configure_sahara_dashboard { cp -a ${SAHARA_DASH_DIR}/sahara_dashboard/enabled/* ${DEST}/horizon/openstack_dashboard/local/enabled/ - # compile message catalogs - # NOTE: "python manage.py compilemessages does not work" - # so we compile translation catalogs directly. - if [ -d sahara_dashboard/locale ]; then - for domain in django djangojs; do - if find sahara_dashboard/locale -type f | grep -q "${domain}.po$"; then - pybabel compile -D ${domain} -d sahara_dashboard/locale - fi - done + # NOTE: If locale directory does not exist, compilemessages will fail, + # so check for an existence of locale directory is required. + if [ -d ${SAHARA_DASH_DIR}/sahara_dashboard/locale ]; then + (cd ${SAHARA_DASH_DIR}/sahara_dashboard; DJANGO_SETTINGS_MODULE=openstack_dashboard.settings ../manage.py compilemessages) fi }