]> review.fuel-infra Code Review - openstack-build/horizon-build.git/commitdiff
Compile l10n strings at post-install phase 13/7213/19
authorTimur Sufiev <tsufiev@mirantis.com>
Mon, 1 Jun 2015 11:35:54 +0000 (14:35 +0300)
committerTimur Sufiev <tsufiev@mirantis.com>
Wed, 3 Jun 2015 10:53:36 +0000 (13:53 +0300)
Doing this should enable changing language in Horizon.

Closes-Bug: #1460613
Change-Id: I961a0b527ab100b334a4f2ef0db8fad31573835f

rpm/SPECS/python-django-horizon.spec
trusty/debian/changelog
trusty/debian/control
trusty/debian/openstack-dashboard.postinst

index d3128c46613a9b1816cc3172adb9fba879380ec3..5fd3030554226ab6087afbba82e79681aa6a2fcc 100644 (file)
@@ -75,6 +75,7 @@ instance VNC console, etc.)
 Summary:    Openstack web user interface reference implementation
 Group:      Applications/System
 
+Requires:   gettext
 Requires:   httpd
 Requires:   mod_wsgi
 Requires:   python-django-horizon >= %{version}
@@ -316,6 +317,15 @@ mkdir -p %{buildroot}%{_sharedstatedir}/openstack-dashboard
 # create /var/log/horizon and own it
 mkdir -p %{buildroot}%{_var}/log/horizon
 
+%post -n openstack-dashboard
+# make sure the l10n strings are compiled
+if [ -d /usr/share/openstack-dashboard/openstack_dashboard/locale -a -e /usr/share/openstack-dashboard/manage.py ] ; then
+  pushd /usr/share/openstack-dashboard/openstack_dashboard
+  %{__python} ../manage.py compilemessages
+  popd
+else
+  echo "Couldn't compile Django l10n strings (.mo files)"
+fi
 
 %check
 # don't run tests on rhel
@@ -406,6 +416,10 @@ mkdir -p %{buildroot}%{_var}/log/horizon
 %doc html
 
 %changelog
+* Mon Jun 01 2015 Timur Sufiev <tsufiev@mirantis.com> 2014.2.b3
+- Update requirements
+- Compile l10n strings at post-install
+
 * Mon Apr 24 2015 Vasyl Saienko <vsaienko@mirantis.com> 2014.2.2
 - added  {python_sitelib}/horizon/backends to files section (LP #1367767)
 
@@ -415,10 +429,8 @@ mkdir -p %{buildroot}%{_var}/log/horizon
 * Mon Apr 06 2015 Ivan Berezovskiy <iberezovskiy@mirantis.com> 2014.2.2
 - Fix netaddr in requirements.txt (LP #1439079)
 
-
 * Mon Mar 02 2015 Mikhail Ivanov <mivanov@mirantis.com> 2014.2.2
 - Update requirements
-
 * Tue Sep 23 2014 Ivan Berezovskiy <iberezovskiy@mirantis.com> 2014.2.b3
 - Update requirements
 - Add simple tests
index 6616521eb776332972bc8d67f2fe27868427d1fd..1d685ebf95c1efda4b8c370646466242bbf3396a 100644 (file)
@@ -1,3 +1,9 @@
+horizon (1:2014.2.2-1~u14.04+mos2) mos6.1; urgency=medium
+
+  * Compile l10n strings at post-install
+
+ -- Vasyl Saienko <vsaienko@mirantis.com> Wed, 02 Jun 2015 22:27:30 +0200
+
 horizon (1:2014.2.2-1~u14.04+mos1) mos6.1; urgency=medium
 
  * Fix version according to Fuel versioning policy:
index a841cc2a5920bb787fafb0f7b30c646c56767c95..b98c010bc1f18b530e8697828d176779141a9ec5 100644 (file)
@@ -84,6 +84,7 @@ Pre-Depends: dpkg (>= 1.15.7.2)
 Depends:
  adduser,
  apache2 | httpd,
+ gettext,
  libapache2-mod-wsgi (>= 2.3),
  python-django-horizon (= ${source:Version}),
  ${misc:Depends},
index ea10944cfc69bfac1a476e080ec2c73b3dc82850..77dcd2048d3c99e36747a86e0f94b46875ceb3f3 100644 (file)
@@ -41,6 +41,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