Compile horizon translation files.

In order to make horizon translations available, it's necessary to compile the
translation files in the horizon source tree. This requires gettext to
be installed. It would be better to do this at install time but it
requires the settings file be complete.

Change-Id: I23e664f97fab4745d91070773cbcf4d675adfb35
Closes-Bug: 1430445
This commit is contained in:
Steve McLellan 2015-03-10 12:49:43 -05:00
parent 55d41bdbfa
commit 9939d7f925
2 changed files with 10 additions and 1 deletions

View File

@ -1,7 +1,7 @@
#!/bin/bash
set -eux
install-packages libapache2-mod-wsgi libssl-dev libffi-dev
install-packages libapache2-mod-wsgi libssl-dev libffi-dev gettext
TEMPLATE_ROOT="$(os-apply-config --print-templates)"
FILES="$(dirname $0)/../files/"

View File

@ -16,6 +16,15 @@ if [ -n "${HORIZON_VENV_DIR:-}" ] ; then
source $HORIZON_VENV_DIR/bin/activate
DJANGO_SETTINGS_MODULE=openstack_dashboard.settings django-admin.py collectstatic --noinput
DJANGO_SETTINGS_MODULE=openstack_dashboard.settings django-admin.py compress
# Compile translations. makemessages isn't necessary because the
# non-English .po files are updated from Transifex. This also has to be
# done here for the same reason as above. It requires gettext.
for project in openstack_dashboard horizon openstack_auth; do
pushd $HORIZON_VENV_DIR/lib/python2.7/site-packages/$project
DJANGO_SETTINGS_MODULE=openstack_dashboard.settings django-admin.py compilemessages
popd
done
else
cp /etc/horizon/local_settings.py /usr/share/openstack-dashboard/openstack_dashboard/local/local_settings.py
sed -i 's#^STATIC_ROOT.*#STATIC_ROOT=/usr/share/openstack-dashboard/static#' /usr/share/openstack-dashboard/openstack_dashboard/local/local_settings.py