Fixed dashboard angular translation issue

We now have javascript files in openstack_dashboard as well. However,
the run_test script does not account for this and only run translation on
the horizon folder. This patch address this problem. Also removed the
invalid gettext('') since that causes the msgid to be blank.

Steps to test:
1. ./run_tests.sh --makemessages
2. ./run_tests.sh --pseudo de
3. ./run_tests.sh --compilemessages
4. set LAUNCH_INSTANCE_NG_ENABLED = True in local_settings.py
5. localhost:8001/settings/ and change to deutsch
6. localhost:port/project/instances/ and click on launch instance

Co-Authored-By: Doug Fish <drfish@us.ibm.com>
Change-Id: If1cd1937d40d359a4a4ecd75406f62e8f8802082
Closes-bug: #1444150
This commit is contained in:
Thai Tran 2015-05-05 11:32:33 -07:00
parent 5f60007283
commit 96130205fc
5 changed files with 14 additions and 5 deletions

View File

@ -0,0 +1,3 @@
{% load url from future %}
{% comment %} Django's JavaScript i18n Implementation {% endcomment %}
<script type="text/javascript" src="{% url 'horizon:jsi18n' 'horizon' %}"></script>

View File

@ -4,8 +4,7 @@
{% datepicker_locale as DATEPICKER_LOCALE %}
{% comment %} Django's JavaScript i18n Implementation {% endcomment %}
<script type="text/javascript" src="{% url 'horizon:jsi18n' 'horizon' %}"></script>
{% include "horizon/_script_i18n.html" %}
{% comment %} Compress jQuery, Angular, Plugins, Bootstrap, Hogan.js and Horizon-specific JS. {% endcomment %}
{% compress js %}

View File

@ -49,7 +49,7 @@
config.label = {
title: gettext('Configuration'),
subtitle: gettext(''),
subtitle: '',
customizationScript: gettext('Customization Script'),
customizationScriptMax: gettext('(Max: 16Kb)'),
loadScriptFromFile: gettext('Load script from a file'),

View File

@ -0,0 +1,3 @@
{% load url from future %}
{% comment %} Django's JavaScript i18n Implementation {% endcomment %}
<script type="text/javascript" src="{% url 'horizon:jsi18n' 'horizon+openstack_dashboard' %}"></script>

View File

@ -439,12 +439,15 @@ function run_makemessages {
cd ../openstack_dashboard
${command_wrapper} $root/manage.py makemessages $DASHBOARD_OPTS $OPTS
DASHBOARD_RESULT=$?
echo -n "openstack_dashboard javascript: "
${command_wrapper} $root/manage.py makemessages -d djangojs $OPTS
DASHBOARD_JS_RESULT=$?
cd ..
if [ $check_only -eq 1 ]; then
git checkout -- horizon/locale/en/LC_MESSAGES/django*.po
git checkout -- openstack_dashboard/locale/en/LC_MESSAGES/django.po
fi
exit $(($HORIZON_PY_RESULT || $HORIZON_JS_RESULT || $DASHBOARD_RESULT))
exit $(($HORIZON_PY_RESULT || $HORIZON_JS_RESULT || $DASHBOARD_RESULT || $DASHBOARD_JS_RESULT))
}
function run_compilemessages {
@ -457,7 +460,7 @@ function run_compilemessages {
cd ..
# English is the source language, so compiled catalogs are unnecessary.
rm -vf horizon/locale/en/LC_MESSAGES/django*.mo
rm -vf openstack_dashboard/locale/en/LC_MESSAGES/django.mo
rm -vf openstack_dashboard/locale/en/LC_MESSAGES/django*.mo
exit $(($HORIZON_PY_RESULT || $DASHBOARD_RESULT))
}
@ -466,6 +469,7 @@ function run_pseudo {
# Use English po file as the source file/pot file just like real Horizon translations
do
${command_wrapper} $root/tools/pseudo.py openstack_dashboard/locale/en/LC_MESSAGES/django.po openstack_dashboard/locale/$lang/LC_MESSAGES/django.po $lang
${command_wrapper} $root/tools/pseudo.py openstack_dashboard/locale/en/LC_MESSAGES/djangojs.po openstack_dashboard/locale/$lang/LC_MESSAGES/djangojs.po $lang
${command_wrapper} $root/tools/pseudo.py horizon/locale/en/LC_MESSAGES/django.po horizon/locale/$lang/LC_MESSAGES/django.po $lang
${command_wrapper} $root/tools/pseudo.py horizon/locale/en/LC_MESSAGES/djangojs.po horizon/locale/$lang/LC_MESSAGES/djangojs.po $lang
done