Recently compiled message catalogs (mo files) were removed
in Horizon and django_openstack_auth repositories.
We need to compile message catalogs to make translations
available for Horizon users. It is useful for developers too.
Change-Id: I0831e8308205c116d8e3bb8b43be7f0dd6fa0c0a
| ... | ... |
@@ -84,6 +84,14 @@ function cleanup_horizon {
|
| 84 | 84 |
# configure_horizon() - Set config files, create data dirs, etc |
| 85 | 85 |
function configure_horizon {
|
| 86 | 86 |
setup_develop $HORIZON_DIR |
| 87 |
+ |
|
| 88 |
+ # Compile message catalogs. |
|
| 89 |
+ # Horizon is installed as develop mode, so we can compile here. |
|
| 90 |
+ # Message catalog compilation is handled by Django admin script, |
|
| 91 |
+ # so compiling them after the installation avoids Django installation twice. |
|
| 92 |
+ cd $HORIZON_DIR |
|
| 93 |
+ ./run_tests.sh -N --compilemessages |
|
| 94 |
+ cd - |
|
| 87 | 95 |
} |
| 88 | 96 |
|
| 89 | 97 |
# init_horizon() - Initialize databases, etc. |
| ... | ... |
@@ -138,6 +146,13 @@ function init_horizon {
|
| 138 | 138 |
# install_django_openstack_auth() - Collect source and prepare |
| 139 | 139 |
function install_django_openstack_auth {
|
| 140 | 140 |
git_clone $HORIZONAUTH_REPO $HORIZONAUTH_DIR $HORIZONAUTH_BRANCH |
| 141 |
+ |
|
| 142 |
+ # Compile message catalogs before installation |
|
| 143 |
+ _prepare_message_catalog_compilation |
|
| 144 |
+ cd $HORIZONAUTH_DIR |
|
| 145 |
+ python setup.py compile_catalog |
|
| 146 |
+ cd - |
|
| 147 |
+ |
|
| 141 | 148 |
setup_install $HORIZONAUTH_DIR |
| 142 | 149 |
} |
| 143 | 150 |
|
| ... | ... |
@@ -160,6 +175,13 @@ function stop_horizon {
|
| 160 | 160 |
stop_apache_server |
| 161 | 161 |
} |
| 162 | 162 |
|
| 163 |
+# NOTE: It can be moved to common functions, but it is only used by compilation |
|
| 164 |
+# of django_openstack_auth catalogs at the moment. |
|
| 165 |
+function _prepare_message_catalog_compilation {
|
|
| 166 |
+ local babel_package=$(grep ^Babel $REQUIREMENTS_DIR/global-requirements.txt) |
|
| 167 |
+ pip_install "$babel_package" |
|
| 168 |
+} |
|
| 169 |
+ |
|
| 163 | 170 |
|
| 164 | 171 |
# Restore xtrace |
| 165 | 172 |
$XTRACE |