Commit f88c1085 by Sarina Canelake

i18n xmodule/course_module.py

LMS-1747
parent ef8671ad
...@@ -35,10 +35,15 @@ def initialize_course_tabs(course): ...@@ -35,10 +35,15 @@ def initialize_course_tabs(course):
# This logic is repeated in xmodule/modulestore/tests/factories.py # This logic is repeated in xmodule/modulestore/tests/factories.py
# so if you change anything here, you need to also change it there. # so if you change anything here, you need to also change it there.
course.tabs = [ course.tabs = [
# Translators: "Courseware" is the title of the page where you access a course's videos and problems.
{"type": "courseware", "name": _("Courseware")}, {"type": "courseware", "name": _("Courseware")},
# Translators: "Course Info" is the name of the course's information and updates page
{"type": "course_info", "name": _("Course Info")}, {"type": "course_info", "name": _("Course Info")},
# Translators: "Discussion" is the title of the course forum page
{"type": "discussion", "name": _("Discussion")}, {"type": "discussion", "name": _("Discussion")},
# Translators: "Wiki" is the title of the course's wiki page
{"type": "wiki", "name": _("Wiki")}, {"type": "wiki", "name": _("Wiki")},
# Translators: "Progress" is the title of the student's grade information page
{"type": "progress", "name": _("Progress")}, {"type": "progress", "name": _("Progress")},
] ]
......
...@@ -392,6 +392,7 @@ class CourseDescriptor(CourseFields, SequenceDescriptor): ...@@ -392,6 +392,7 @@ class CourseDescriptor(CourseFields, SequenceDescriptor):
Expects the same arguments as XModuleDescriptor.__init__ Expects the same arguments as XModuleDescriptor.__init__
""" """
super(CourseDescriptor, self).__init__(*args, **kwargs) super(CourseDescriptor, self).__init__(*args, **kwargs)
_ = self.runtime.service(self, "i18n").ugettext
if self.wiki_slug is None: if self.wiki_slug is None:
if isinstance(self.location, Location): if isinstance(self.location, Location):
...@@ -419,8 +420,9 @@ class CourseDescriptor(CourseFields, SequenceDescriptor): ...@@ -419,8 +420,9 @@ class CourseDescriptor(CourseFields, SequenceDescriptor):
self._grading_policy = {} self._grading_policy = {}
self.set_grading_policy(self.grading_policy) self.set_grading_policy(self.grading_policy)
if self.discussion_topics == {}: if self.discussion_topics == {}:
self.discussion_topics = {'General': {'id': self.location.html_id()}} self.discussion_topics = {_('General'): {'id': self.location.html_id()}}
# TODO check that this is still needed here and can't be by defaults. # TODO check that this is still needed here and can't be by defaults.
if not self.tabs: if not self.tabs:
...@@ -428,7 +430,8 @@ class CourseDescriptor(CourseFields, SequenceDescriptor): ...@@ -428,7 +430,8 @@ class CourseDescriptor(CourseFields, SequenceDescriptor):
# first arg, since that's only used for dispatch # first arg, since that's only used for dispatch
tabs = [] tabs = []
tabs.append({'type': 'courseware'}) tabs.append({'type': 'courseware'})
tabs.append({'type': 'course_info', 'name': 'Course Info'}) # Translators: "Course Info" is the name of the course's information and updates page
tabs.append({'type': 'course_info', 'name': _('Course Info')})
if self.syllabus_present: if self.syllabus_present:
tabs.append({'type': 'syllabus'}) tabs.append({'type': 'syllabus'})
...@@ -441,12 +444,15 @@ class CourseDescriptor(CourseFields, SequenceDescriptor): ...@@ -441,12 +444,15 @@ class CourseDescriptor(CourseFields, SequenceDescriptor):
if self.discussion_link: if self.discussion_link:
tabs.append({'type': 'external_discussion', 'link': self.discussion_link}) tabs.append({'type': 'external_discussion', 'link': self.discussion_link})
else: else:
tabs.append({'type': 'discussion', 'name': 'Discussion'}) # Translators: "Discussion" is the title of the course forum page
tabs.append({'type': 'discussion', 'name': _('Discussion')})
tabs.append({'type': 'wiki', 'name': 'Wiki'}) # Translators: "Wiki" is the title of the course's wiki page
tabs.append({'type': 'wiki', 'name': _('Wiki')})
if not self.hide_progress_tab: if not self.hide_progress_tab:
tabs.append({'type': 'progress', 'name': 'Progress'}) # Translators: "Progress" is the title of the student's grade information page
tabs.append({'type': 'progress', 'name': _('Progress')})
self.tabs = tabs self.tabs = tabs
...@@ -770,7 +776,10 @@ class CourseDescriptor(CourseFields, SequenceDescriptor): ...@@ -770,7 +776,10 @@ class CourseDescriptor(CourseFields, SequenceDescriptor):
xmoduledescriptors.append(s) xmoduledescriptors.append(s)
# The xmoduledescriptors included here are only the ones that have scores. # The xmoduledescriptors included here are only the ones that have scores.
section_description = {'section_descriptor': s, 'xmoduledescriptors': filter(lambda child: child.has_score, xmoduledescriptors)} section_description = {
'section_descriptor': s,
'xmoduledescriptors': filter(lambda child: child.has_score, xmoduledescriptors)
}
section_format = s.format if s.format is not None else '' section_format = s.format if s.format is not None else ''
graded_sections[section_format] = graded_sections.get(section_format, []) + [section_description] graded_sections[section_format] = graded_sections.get(section_format, []) + [section_description]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment