Permalink
Browse files

[bug 952642] Use the static i18n js. Compile on deploy.

  • Loading branch information...
1 parent ca15fd3 commit 92d30e1a7ce1b5215857f8da8829d85540e83570 @rlr rlr committed Feb 13, 2014
@@ -7,7 +7,7 @@
*
* Include this __after__ the Django script.
*/
-if (typeof(catalog) === 'undefined') {
+if (typeof(catalog) === 'undefined' && typof(django) === 'undefined' && typeof(django.catalog) === 'undefined') {
gettext = function (msgid) {
return msgid;
};
@@ -211,7 +211,11 @@
</div>
</footer>{# /#footer #}
-<script src="{{ url('jsi18n') }}build:{{ BUILD_ID_JS }}"></script>
+{# TODO: The BUILD_ID_JS changes whenever our js code changes.
+ But this should get cached busted whenever a locale is updated.
+ It's complicatred to fix. But for now it isn't more broken than
+ before. #}
+<script src="{{ STATIC_URL }}jsi18n/{{ request.LANGUAGE_CODE }}/javascript.js?{{ BUILD_ID_JS }}"></script>
{# Optimizely script for A/B testing - Bug 850816 #}
{% if waffle.flag('optimizely') %}
@@ -157,7 +157,11 @@
{% block after_main %}{% endblock %}
-<script src="{{ url('jsi18n') }}/build:{{ BUILD_ID_JS }}"></script>
+{# TODO: The BUILD_ID_JS changes whenever our js code changes.
+ But this should get cached busted whenever a locale is updated.
+ It's complicatred to fix. But for now it isn't more broken than
+ before. #}
+<script src="{{ STATIC_URL }}jsi18n/{{ request.LANGUAGE_CODE }}/javascript.js?{{ BUILD_ID_JS }}"></script>
{{ js('mobile/common') }}
{% for script in scripts %}
View
@@ -40,6 +40,7 @@ def update_locales(ctx):
with ctx.lcd(settings.SRC_DIR):
ctx.local('date > media/postatus.txt')
ctx.local('./scripts/compile-linted-mo.sh | /usr/bin/tee -a media/postatus.txt')
+ ctx.local('python2.6 manage.py compilejsi18n')
@task

0 comments on commit 92d30e1

Please sign in to comment.