def upload_js_catalogs(self): headers = self.cache_forever_headers() headers['Content-Type'] = 'application/javascript' for locale in self.all_locales(): filename = "jsi18catalog/{}.js".format(locale) activate(locale) catalog, plural = get_javascript_catalog(locale, 'djangojs', []) response = render_javascript_catalog(catalog, plural) self.upload_string(filename, response.content, headers)
def js_i18n_catalog(request, locale): catalog, plural = get_javascript_catalog(locale, 'djangojs', []) return render_javascript_catalog(catalog, plural)
def js_i18n_catalog(request): catalog, plural = get_javascript_catalog(to_locale(request.LANGUAGE_CODE), 'djangojs', []) return render_javascript_catalog(catalog, plural)