diff --git a/cms/djangoapps/contentstore/views/assets.py b/cms/djangoapps/contentstore/views/assets.py index b24b74b9a7..4fd56f3cbf 100644 --- a/cms/djangoapps/contentstore/views/assets.py +++ b/cms/djangoapps/contentstore/views/assets.py @@ -79,7 +79,7 @@ def assets_handler(request, course_key_string=None, asset_key_string=None): return _update_asset(request, course_key, asset_key) elif request.method == 'GET': # assume html - return _asset_index(course_key) + return _asset_index(request, course_key) return HttpResponseNotFound() @@ -92,7 +92,7 @@ def _request_response_format_is_json(request, response_format): return response_format == 'json' or 'application/json' in request.META.get('HTTP_ACCEPT', 'application/json') -def _asset_index(course_key): +def _asset_index(request, course_key): ''' Display an editable asset library. @@ -101,6 +101,7 @@ def _asset_index(course_key): course_module = modulestore().get_course(course_key) return render_to_response('asset_index.html', { + 'language_code': request.LANGUAGE_CODE, 'waffle_flag_enabled': NewAssetsPageFlag.feature_enabled(course_key), 'context_course': course_module, 'max_file_size_in_mbs': settings.MAX_ASSET_UPLOAD_FILE_SIZE_IN_MB, diff --git a/cms/djangoapps/contentstore/views/public.py b/cms/djangoapps/contentstore/views/public.py index 843ed47731..f054564534 100644 --- a/cms/djangoapps/contentstore/views/public.py +++ b/cms/djangoapps/contentstore/views/public.py @@ -75,9 +75,11 @@ def howitworks(request): @waffle_switch('{}.{}'.format(waffle.WAFFLE_NAMESPACE, waffle.ENABLE_ACCESSIBILITY_POLICY_PAGE)) -def accessibility(_request): +def accessibility(request): """ Display the accessibility accommodation form. """ - return render_to_response('accessibility.html', {}) + return render_to_response('accessibility.html', { + 'language_code': request.LANGUAGE_CODE + }) diff --git a/cms/templates/accessibility.html b/cms/templates/accessibility.html index d5e77418eb..ce495876d5 100644 --- a/cms/templates/accessibility.html +++ b/cms/templates/accessibility.html @@ -18,8 +18,10 @@
- <%static:studiofrontend page="AccessibilityPage" lang="en"> - {} + <%static:studiofrontend page="AccessibilityPage"> + { + "lang": "${language_code | n, js_escaped_string}", + }
diff --git a/cms/templates/asset_index.html b/cms/templates/asset_index.html index 85ea3db094..a810e35ee5 100644 --- a/cms/templates/asset_index.html +++ b/cms/templates/asset_index.html @@ -58,8 +58,9 @@
<%static:optional_include_mako file="asset_index_content_header.html" /> % if waffle_flag_enabled: - <%static:studiofrontend page="AssetsPage" lang="en"> + <%static:studiofrontend page="AssetsPage"> { + "lang": "${language_code | n, js_escaped_string}", "course": { "id": "${context_course.id | n, js_escaped_string}", "name": "${context_course.display_name_with_default | n, js_escaped_string}", diff --git a/common/djangoapps/pipeline_mako/templates/static_content.html b/common/djangoapps/pipeline_mako/templates/static_content.html index 56593458f5..170dbde87b 100644 --- a/common/djangoapps/pipeline_mako/templates/static_content.html +++ b/common/djangoapps/pipeline_mako/templates/static_content.html @@ -89,7 +89,7 @@ engine = Engine(dirs=settings.DEFAULT_TEMPLATE_ENGINE['DIRS']) source, template_path = Loader(engine).load_template_source(path) %>${source | n, decode.utf8} -<%def name="studiofrontend(page, lang='en')"> +<%def name="studiofrontend(page)"> <%doc> Loads a studio-frontend page, with the necessary context. Context is expected as a dictionary in the body of this tag. @@ -101,8 +101,6 @@ source, template_path = Loader(engine).load_template_source(path) <% body = capture(caller.body) - body_dict = json.loads(body) - body_dict['lang'] = lang %>