]> review.fuel-infra Code Review - openstack-build/horizon-build.git/commitdiff
Compile l10n strings at post-install phase 94/7494/1
authorvsaienko <vsaienko@mirantis.com>
Thu, 4 Jun 2015 07:51:16 +0000 (10:51 +0300)
committervsaienko <vsaienko@mirantis.com>
Thu, 4 Jun 2015 07:51:16 +0000 (10:51 +0300)
 Doing this should enable changing language in Horizon.
 add new dependency: gettext
 fix tabs

Change-Id: I75d0eac50943eddc3ec8acc9378726c4ecc61985
Closes-Bug: #1460613

trusty/debian/changelog
trusty/debian/control
trusty/debian/openstack-dashboard.postinst

index 03f9433aadb997382144ec474d7e3ed6f388312f..52adf1d13fbda29afac75fae4402280f465b7c66 100644 (file)
@@ -1,3 +1,10 @@
+horizon (1:2015.1.0-1~u14.04+mos4) mos7.0; urgency=medium
+
+  * Compile l10n strings at post-install
+  add new dependency: gettext
+
+ -- Vasyl Saienko <vsaienko@mirantis.com> Thu, 04 Jun 2015 22:27:30 +0200
+
 horizon (1:2015.1.0-1~u14.04+mos3) mos7.0; urgency=medium
 
   * Fix python-oslo-* naming scheme
index f7a726d09c7ea5b6df042c7f1716800daed401ff..560e442de106b5064f7c94eb2a81a40528f5a49d 100644 (file)
@@ -24,6 +24,7 @@ Depends:
  python-pbr (>= 0.10),
  python-babel (>= 1.3),
  python-django (>= 1.4.2),
+ gettext,
  python-pint (>= 0.5),
  python-cloudfiles,
  python-compressor (>= 1.4),
index 702422b48c5ef3342f8077e599620257367c18ba..ac79cc254ddd4f6d43ac25da5ea29123f6f7716d 100644 (file)
@@ -17,15 +17,15 @@ if [ "$1" = "configure" ]; then
     /etc/apache2/conf-available/$CONF \
     1:2013.2~b2-0ubuntu3 -- "$@"
 
-       if ! getent group horizon > /dev/null 2>&1
-       then
-               addgroup --system horizon >/dev/null
-       fi
-       if ! getent passwd horizon > /dev/null 2>&1
-       then
-    adduser --system --home /usr/share/openstack-dashboard/ --ingroup horizon \
-            --no-create-home --shell /bin/false horizon
-       fi
+  if ! getent group horizon > /dev/null 2>&1
+  then
+    addgroup --system horizon >/dev/null
+  fi
+  if ! getent passwd horizon > /dev/null 2>&1
+  then
+      adduser --system --home /usr/share/openstack-dashboard/ --ingroup horizon \
+        --no-create-home --shell /bin/false horizon
+  fi
 
   (
     cd /usr/share/openstack-dashboard
@@ -40,6 +40,15 @@ if [ "$1" = "configure" ]; then
       /usr/share/openstack-dashboard/openstack_dashboard/static
   fi
 
+  if [ -d /usr/share/openstack-dashboard/openstack_dashboard/locale -a -e /usr/share/openstack-dashboard/manage.py ] ; then
+    curdir=$(pwd)
+    cd /usr/share/openstack-dashboard/openstack_dashboard
+    python ../manage.py compilemessages
+    cd "${curdir}"
+  else
+    echo "Couldn't compile Django l10n strings (.mo files)"
+  fi
+
   if [ -d /etc/openstack-dashboard/ ] ; then
     chown horizon:horizon /etc/openstack-dashboard/
   fi