From 80994a360c943c62cfd4361874cf1be7c3cf0c03 Mon Sep 17 00:00:00 2001 From: limin0801 Date: Mon, 6 Jul 2020 17:10:34 +0800 Subject: [PATCH] Add horizon internationalization for extra panels When introduces extra panels in horizon, eg. ironic-ui, it could not achieve internationalization. This commit hope to achieve internationalization. Related bug: #1886396 Change-Id: Ic4b89d14ee27bb6c70e792193cbf23de1ae553a4 --- horizon/templates/bin/_horizon.sh.tpl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/horizon/templates/bin/_horizon.sh.tpl b/horizon/templates/bin/_horizon.sh.tpl index 23fbe7ffee..34df3914ed 100644 --- a/horizon/templates/bin/_horizon.sh.tpl +++ b/horizon/templates/bin/_horizon.sh.tpl @@ -64,6 +64,14 @@ function start () { # If the image has support for it, compile the translations if type -p gettext >/dev/null 2>/dev/null; then cd ${SITE_PACKAGES_ROOT}/openstack_dashboard; /tmp/manage.py compilemessages + # if there are extra panels and the image has support for it, compile the translations + {{- range .Values.conf.horizon.extra_panels }} + PANEL_DIR="${SITE_PACKAGES_ROOT}/{{ . }}" + if [ -d ${PANEL_DIR} ]; then + cd ${PANEL_DIR}; /tmp/manage.py compilemessages + fi + {{- end }} + unset PANEL_DIR fi # Compress Horizon's assets.