diff options
author | Randy Bertram <rbertram@us.ibm.com> | 2014-09-09 17:28:17 -0400 |
---|---|---|
committer | Randy Bertram <rbertram@us.ibm.com> | 2014-09-23 14:24:48 +0000 |
commit | 78c917570e2182bfdd8f5cb7eb5cb2c71d8df6f0 (patch) | |
tree | 6d6938af5f788c1f7c6b49b581940e3e5ea46589 /horizon/templates | |
parent | e0e46374de3ff041ba0bbde81eaabe7563792186 (diff) | |
download | horizon-78c917570e2182bfdd8f5cb7eb5cb2c71d8df6f0.tar.gz |
Datepicker locale support
Also adds general language info to the
horizon JS object.
Change-Id: I8fbf20635ac0a2ae1f3b8f618ce5a37eb53e9cc0
Closes-Bug: 1274145
Diffstat (limited to 'horizon/templates')
-rw-r--r-- | horizon/templates/horizon/_conf.html | 9 | ||||
-rw-r--r-- | horizon/templates/horizon/_scripts.html | 6 |
2 files changed, 15 insertions, 0 deletions
diff --git a/horizon/templates/horizon/_conf.html b/horizon/templates/horizon/_conf.html index b846cac3d..790912221 100644 --- a/horizon/templates/horizon/_conf.html +++ b/horizon/templates/horizon/_conf.html @@ -1,4 +1,8 @@ {% load compress %} +{% load datepicker_locale from horizon %} + +{% datepicker_locale as DATEPICKER_LOCALE %} + {% compress js %} <script src='{{ STATIC_URL }}horizon/lib/jquery/jquery.js' type='text/javascript' charset="utf-8"></script> <script src='{{ STATIC_URL }}horizon/lib/jquery/jquery-migrate.js' type='text/javascript' charset="utf-8"></script> @@ -8,6 +12,11 @@ {% endcompress %} <script type='text/javascript' charset='utf-8'> + // make translation info available on client + horizon.languageCode = '{{ LANGUAGE_CODE }}'; + horizon.languageBidi = '{{ LANGUAGE_BIDI }}'; + horizon.datepickerLocale = '{{ DATEPICKER_LOCALE }}'; + /* Load angular modules extensions list before we include angular/horizon.js */ var angularModuleExtension = {{ HORIZON_CONFIG.angular_modules|default:"[]"|safe }}; </script> diff --git a/horizon/templates/horizon/_scripts.html b/horizon/templates/horizon/_scripts.html index bd87edebd..3e3ec4fbb 100644 --- a/horizon/templates/horizon/_scripts.html +++ b/horizon/templates/horizon/_scripts.html @@ -1,5 +1,8 @@ {% load compress %} {% load url from future %} +{% load datepicker_locale from horizon %} + +{% datepicker_locale as DATEPICKER_LOCALE %} {% comment %} Django's JavaScript i18n Implementation {% endcomment %} <script type="text/javascript" src="{% url 'horizon:jsi18n' 'horizon' %}"></script> @@ -29,6 +32,9 @@ <script src="{{ STATIC_URL }}bootstrap/js/bootstrap.js" type="text/javascript" charset="utf-8"></script> <script src='{{ STATIC_URL }}horizon/lib/bootstrap_datepicker/bootstrap-datepicker.js' type='text/javascript' charset='utf-8'></script> +{% ifnotequal DATEPICKER_LOCALE 'en' %} +<script src='{{ STATIC_URL }}horizon/lib/bootstrap_datepicker/locales/bootstrap-datepicker.{{ DATEPICKER_LOCALE }}.js' type='text/javascript' charset='utf-8'></script> +{% endifnotequal %} <script src="{{ STATIC_URL }}horizon/lib/hogan.js" type="text/javascript" charset='utf-8'></script> |