From b1074ff1acc0d05a28569550cf5c1c188e860be6 Mon Sep 17 00:00:00 2001 From: Miles Steele Date: Fri, 9 Aug 2013 16:56:35 -0400 Subject: [PATCH] add i18n --- .../instructor/views/instructor_dashboard.py | 13 +-- .../instructor_dashboard_2/analytics.html | 13 +-- .../instructor_dashboard_2/course_info.html | 15 ++-- .../instructor_dashboard_2/data_download.html | 5 +- .../instructor_dashboard_2.html | 3 +- .../instructor_dashboard_2/membership.html | 84 +++++++++---------- .../instructor_dashboard_2/student_admin.html | 62 +++++++------- 7 files changed, 101 insertions(+), 94 deletions(-) diff --git a/lms/djangoapps/instructor/views/instructor_dashboard.py b/lms/djangoapps/instructor/views/instructor_dashboard.py index c37fb1bc9f..9a1bea222e 100644 --- a/lms/djangoapps/instructor/views/instructor_dashboard.py +++ b/lms/djangoapps/instructor/views/instructor_dashboard.py @@ -2,6 +2,7 @@ Instructor Dashboard Views """ +from django.utils.translation import ugettext as _ from django_future.csrf import ensure_csrf_cookie from django.views.decorators.cache import cache_control from mitxmako.shortcuts import render_to_response @@ -72,7 +73,7 @@ def _section_course_info(course_id): section_data = {} section_data['section_key'] = 'course_info' - section_data['section_display_name'] = 'Course Info' + section_data['section_display_name'] = _('Course Info') section_data['course_id'] = course_id section_data['course_display_name'] = course.display_name section_data['enrollment_count'] = CourseEnrollment.objects.filter(course_id=course_id).count() @@ -87,7 +88,7 @@ def _section_course_info(course_id): # section_data['offline_grades'] = offline_grades_available(course_id) try: - section_data['course_errors'] = [(escape(a), '') for (a, _) in modulestore().get_item_errors(course.location)] + section_data['course_errors'] = [(escape(a), '') for (a, _unused) in modulestore().get_item_errors(course.location)] except Exception: section_data['course_errors'] = [('Error fetching errors', '')] @@ -98,7 +99,7 @@ def _section_membership(course_id, access): """ Provide data for the corresponding dashboard section """ section_data = { 'section_key': 'membership', - 'section_display_name': 'Membership', + 'section_display_name': _('Membership'), 'access': access, 'enroll_button_url': reverse('students_update_enrollment', kwargs={'course_id': course_id}), 'unenroll_button_url': reverse('students_update_enrollment', kwargs={'course_id': course_id}), @@ -114,7 +115,7 @@ def _section_student_admin(course_id, access): """ Provide data for the corresponding dashboard section """ section_data = { 'section_key': 'student_admin', - 'section_display_name': 'Student Admin', + 'section_display_name': _('Student Admin'), 'access': access, 'get_student_progress_url_url': reverse('get_student_progress_url', kwargs={'course_id': course_id}), 'enrollment_url': reverse('students_update_enrollment', kwargs={'course_id': course_id}), @@ -129,7 +130,7 @@ def _section_data_download(course_id): """ Provide data for the corresponding dashboard section """ section_data = { 'section_key': 'data_download', - 'section_display_name': 'Data Download', + 'section_display_name': _('Data Download'), 'get_grading_config_url': reverse('get_grading_config', kwargs={'course_id': course_id}), 'get_students_features_url': reverse('get_students_features', kwargs={'course_id': course_id}), } @@ -140,7 +141,7 @@ def _section_analytics(course_id): """ Provide data for the corresponding dashboard section """ section_data = { 'section_key': 'analytics', - 'section_display_name': 'Analytics', + 'section_display_name': _('Analytics'), 'get_distribution_url': reverse('get_distribution', kwargs={'course_id': course_id}), 'proxy_legacy_analytics_url': reverse('proxy_legacy_analytics', kwargs={'course_id': course_id}), } diff --git a/lms/templates/instructor/instructor_dashboard_2/analytics.html b/lms/templates/instructor/instructor_dashboard_2/analytics.html index 8469c1db93..baa446cf74 100644 --- a/lms/templates/instructor/instructor_dashboard_2/analytics.html +++ b/lms/templates/instructor/instructor_dashboard_2/analytics.html @@ -1,3 +1,4 @@ +<%! from django.utils.translation import ugettext as _ %> <%page args="section_data"/>
-

Batch Enrollment

-

Enter student emails separated by new lines or commas.

- +

${_("Batch Enrollment")}

+

${_("Enter student emails separated by new lines or commas.")}

+
- - - - + + + +
-

If auto enroll is checked, students who have not yet registered for edX will be automatically enrolled. - If auto enroll is left unchecked, students who have not yet registered for edX will not be enrolled, - but will be allowed to enroll. +

${_("If auto enroll is")} ${_("checked")}${_(", students who have not yet registered for edX will be automatically enrolled.")} + ${_("If auto enroll is left")} ${_("unchecked")}, ${_("students who have not yet registered for edX will not be enrolled, but will be allowed to enroll.")}

@@ -46,92 +46,92 @@
-

Administration List Management

+

${_("Administration List Management")}

%if not section_data['access']['instructor']:

- Staff cannot modify staff or beta tester lists. To modify these lists, - contact your instructor and ask them to add you as an instructor for staff - and beta lists, or a forum admin for forum management. + ${_("Staff cannot modify staff or beta tester lists. To modify these lists, " + "contact your instructor and ask them to add you as an instructor for staff " + "and beta lists, or a forum admin for forum management.")}

%endif %if section_data['access']['instructor']:
%endif %if section_data['access']['instructor'] or section_data['access']['forum_admin']:
%endif diff --git a/lms/templates/instructor/instructor_dashboard_2/student_admin.html b/lms/templates/instructor/instructor_dashboard_2/student_admin.html index bf99fcea57..047369fc46 100644 --- a/lms/templates/instructor/instructor_dashboard_2/student_admin.html +++ b/lms/templates/instructor/instructor_dashboard_2/student_admin.html @@ -1,50 +1,51 @@ +<%! from django.utils.translation import ugettext as _ %> <%page args="section_data"/>
-

Student-specific grade adjustment

+

${_("Student-specific grade adjustment")}

- +

- - + + ##

Specify a particular problem in the course here by its url:

- +

- You may use just the "urlname" if a problem, or "modulename/urlname" if not. - (For example, if the location is i4x://university/course/problem/problemname, - then just provide the problemname. - If the location is i4x://university/course/notaproblem/someothername, then - provide notaproblem/someothername.) + ${_('You may use just the "urlname" if a problem, or "modulename/urlname" if not. ' + '(For example, if the location is i4x://university/course/problem/problemname, ' + 'then just provide the problemname. ' + 'If the location is i4x://university/course/notaproblem/someothername, then ' + 'provide notaproblem/someothername.)')}

- + %if section_data['access']['instructor']:

You may also delete the entire state of a student for the specified module:

- + %endif %if settings.MITX_FEATURES.get('ENABLE_INSTRUCTOR_BACKGROUND_TASKS') and section_data['access']['instructor']: - + %endif %if settings.MITX_FEATURES.get('ENABLE_INSTRUCTOR_BACKGROUND_TASKS') and section_data['access']['instructor']:

- Rescoring runs in the background, and status for active tasks will appear in a table below. - To see status for all tasks submitted for this course and student, click on this button: + ${_("Rescoring runs in the background, and status for active tasks will appear in a table below. " + "To see status for all tasks submitted for this problem and student, click on this button:")}

- +
%endif
@@ -56,26 +57,27 @@

- Specify a particular problem in the course here by its url: + ${_("Specify a particular problem in the course here by its url:")}

- You may use just the "urlname" if a problem, or "modulename/urlname" if not. - (For example, if the location is i4x://university/course/problem/problemname, - then just provide the problemname. - If the location is i4x://university/course/notaproblem/someothername, then - provide notaproblem/someothername.) + ${_('You may use just the "urlname" if a problem, or "modulename/urlname" if not. ' + '(For example, if the location is i4x://university/course/problem/problemname, ' + 'then just provide the problemname. ' + 'If the location is i4x://university/course/notaproblem/someothername, then ' + 'provide notaproblem/someothername.)')}

- Then select an action: - - + ${_("Then select an action")}: + +

-

These actions run in the background, and status for active tasks will appear in a table below. - To see status for all tasks submitted for this problem, click on this button: +

+ ${_("These actions run in the background, and status for active tasks will appear in a table below. " + "To see status for all tasks submitted for this problem, click on this button")}:

- +

@@ -83,7 +85,7 @@

-

Pending Instructor Tasks

+

${_("Pending Instructor Tasks")}

%endif