Commit ecd23739 by Diana Huang

Merge pull request #8617 from edx/diana/course-tab-cleanup

Switch tabs to use ugettext_noop for titles.
parents bfd250ed e6cbff47
...@@ -28,7 +28,8 @@ class CourseTab(object): ...@@ -28,7 +28,8 @@ class CourseTab(object):
# subclass, shared by all instances of the subclass. # subclass, shared by all instances of the subclass.
type = '' type = ''
# The title of the tab, which should be internationalized # The title of the tab, which should be internationalized using
# ugettext_noop since the user won't be available in this context.
title = None title = None
# Class property that specifies whether the tab can be hidden for a particular course # Class property that specifies whether the tab can be hidden for a particular course
......
...@@ -3,7 +3,7 @@ Registers the CCX feature for the edX platform. ...@@ -3,7 +3,7 @@ Registers the CCX feature for the edX platform.
""" """
from django.conf import settings from django.conf import settings
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext_noop
from xmodule.tabs import CourseTab from xmodule.tabs import CourseTab
from student.roles import CourseCcxCoachRole from student.roles import CourseCcxCoachRole
...@@ -15,7 +15,7 @@ class CcxCourseTab(CourseTab): ...@@ -15,7 +15,7 @@ class CcxCourseTab(CourseTab):
""" """
type = "ccx_coach" type = "ccx_coach"
title = _("CCX Coach") title = ugettext_noop("CCX Coach")
view_name = "ccx_coach_dashboard" view_name = "ccx_coach_dashboard"
is_dynamic = True # The CCX view is dynamically added to the set of tabs when it is enabled is_dynamic = True # The CCX view is dynamically added to the set of tabs when it is enabled
......
...@@ -4,7 +4,7 @@ a user has on an article. ...@@ -4,7 +4,7 @@ a user has on an article.
""" """
from django.conf import settings from django.conf import settings
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext_noop
from courseware.tabs import EnrolledTab from courseware.tabs import EnrolledTab
...@@ -15,7 +15,7 @@ class WikiTab(EnrolledTab): ...@@ -15,7 +15,7 @@ class WikiTab(EnrolledTab):
""" """
type = "wiki" type = "wiki"
title = _('Wiki') title = ugettext_noop('Wiki')
view_name = "course_wiki" view_name = "course_wiki"
is_hideable = True is_hideable = True
is_default = False is_default = False
......
...@@ -3,7 +3,7 @@ This module is essentially a broker to xmodule/tabs.py -- it was originally intr ...@@ -3,7 +3,7 @@ This module is essentially a broker to xmodule/tabs.py -- it was originally intr
perform some LMS-specific tab display gymnastics for the Entrance Exams feature perform some LMS-specific tab display gymnastics for the Entrance Exams feature
""" """
from django.conf import settings from django.conf import settings
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _, ugettext_noop
from courseware.access import has_access from courseware.access import has_access
from courseware.entrance_exams import user_must_complete_entrance_exam from courseware.entrance_exams import user_must_complete_entrance_exam
...@@ -28,7 +28,7 @@ class CoursewareTab(EnrolledTab): ...@@ -28,7 +28,7 @@ class CoursewareTab(EnrolledTab):
The main courseware view. The main courseware view.
""" """
type = 'courseware' type = 'courseware'
title = _('Courseware') title = ugettext_noop('Courseware')
priority = 10 priority = 10
view_name = 'courseware' view_name = 'courseware'
is_movable = False is_movable = False
...@@ -40,7 +40,7 @@ class CourseInfoTab(CourseTab): ...@@ -40,7 +40,7 @@ class CourseInfoTab(CourseTab):
The course info view. The course info view.
""" """
type = 'course_info' type = 'course_info'
title = _('Course Info') title = ugettext_noop('Course Info')
priority = 20 priority = 20
view_name = 'info' view_name = 'info'
tab_id = 'info' tab_id = 'info'
...@@ -57,7 +57,7 @@ class SyllabusTab(EnrolledTab): ...@@ -57,7 +57,7 @@ class SyllabusTab(EnrolledTab):
A tab for the course syllabus. A tab for the course syllabus.
""" """
type = 'syllabus' type = 'syllabus'
title = _('Syllabus') title = ugettext_noop('Syllabus')
priority = 30 priority = 30
view_name = 'syllabus' view_name = 'syllabus'
allow_multiple = True allow_multiple = True
...@@ -75,7 +75,7 @@ class ProgressTab(EnrolledTab): ...@@ -75,7 +75,7 @@ class ProgressTab(EnrolledTab):
The course progress view. The course progress view.
""" """
type = 'progress' type = 'progress'
title = _('Progress') title = ugettext_noop('Progress')
priority = 40 priority = 40
view_name = 'progress' view_name = 'progress'
is_hideable = True is_hideable = True
...@@ -93,7 +93,7 @@ class TextbookTabsBase(CourseTab): ...@@ -93,7 +93,7 @@ class TextbookTabsBase(CourseTab):
Abstract class for textbook collection tabs classes. Abstract class for textbook collection tabs classes.
""" """
# Translators: 'Textbooks' refers to the tab in the course that leads to the course' textbooks # Translators: 'Textbooks' refers to the tab in the course that leads to the course' textbooks
title = _("Textbooks") title = ugettext_noop("Textbooks")
is_collection = True is_collection = True
is_default = False is_default = False
...@@ -225,7 +225,7 @@ class ExternalDiscussionCourseTab(LinkTab): ...@@ -225,7 +225,7 @@ class ExternalDiscussionCourseTab(LinkTab):
type = 'external_discussion' type = 'external_discussion'
# Translators: 'Discussion' refers to the tab in the courseware that leads to the discussion forums # Translators: 'Discussion' refers to the tab in the courseware that leads to the discussion forums
title = _('Discussion') title = ugettext_noop('Discussion')
priority = None priority = None
is_default = False is_default = False
......
...@@ -13,7 +13,7 @@ from django.core.context_processors import csrf ...@@ -13,7 +13,7 @@ from django.core.context_processors import csrf
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from django.contrib.auth.models import User from django.contrib.auth.models import User
from django.http import Http404, HttpResponseBadRequest from django.http import Http404, HttpResponseBadRequest
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext_noop
from django.views.decorators.http import require_GET from django.views.decorators.http import require_GET
import newrelic.agent import newrelic.agent
...@@ -55,7 +55,7 @@ class DiscussionTab(EnrolledTab): ...@@ -55,7 +55,7 @@ class DiscussionTab(EnrolledTab):
""" """
type = 'discussion' type = 'discussion'
title = _('Discussion') title = ugettext_noop('Discussion')
priority = None priority = None
view_name = 'django_comment_client.forum.views.forum_form_discussion' view_name = 'django_comment_client.forum.views.forum_form_discussion'
is_hideable = settings.FEATURES.get('ALLOW_HIDING_DISCUSSION_TAB', False) is_hideable = settings.FEATURES.get('ALLOW_HIDING_DISCUSSION_TAB', False)
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
Registers the "edX Notes" feature for the edX platform. Registers the "edX Notes" feature for the edX platform.
""" """
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext_noop
from courseware.tabs import EnrolledTab from courseware.tabs import EnrolledTab
...@@ -13,7 +13,7 @@ class EdxNotesTab(EnrolledTab): ...@@ -13,7 +13,7 @@ class EdxNotesTab(EnrolledTab):
""" """
type = "edxnotes" type = "edxnotes"
title = _("Notes") title = ugettext_noop("Notes")
view_name = "edxnotes" view_name = "edxnotes"
@classmethod @classmethod
......
...@@ -11,7 +11,7 @@ import pytz ...@@ -11,7 +11,7 @@ import pytz
from django.contrib.auth.decorators import login_required from django.contrib.auth.decorators import login_required
from django.views.decorators.http import require_POST from django.views.decorators.http import require_POST
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _, ugettext_noop
from django.views.decorators.csrf import ensure_csrf_cookie from django.views.decorators.csrf import ensure_csrf_cookie
from django.views.decorators.cache import cache_control from django.views.decorators.cache import cache_control
from edxmako.shortcuts import render_to_response from edxmako.shortcuts import render_to_response
...@@ -53,7 +53,7 @@ class InstructorDashboardTab(CourseTab): ...@@ -53,7 +53,7 @@ class InstructorDashboardTab(CourseTab):
""" """
type = "instructor" type = "instructor"
title = _('Instructor') title = ugettext_noop('Instructor')
view_name = "instructor_dashboard" view_name = "instructor_dashboard"
is_dynamic = True # The "Instructor" tab is instead dynamically added when it is enabled is_dynamic = True # The "Instructor" tab is instead dynamically added when it is enabled
......
...@@ -13,7 +13,7 @@ from courseware.tabs import EnrolledTab ...@@ -13,7 +13,7 @@ from courseware.tabs import EnrolledTab
from notes.models import Note from notes.models import Note
from notes.utils import notes_enabled_for_course from notes.utils import notes_enabled_for_course
from xmodule.annotator_token import retrieve_token from xmodule.annotator_token import retrieve_token
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext_noop
@login_required @login_required
...@@ -45,7 +45,7 @@ class NotesTab(EnrolledTab): ...@@ -45,7 +45,7 @@ class NotesTab(EnrolledTab):
A tab for the course notes. A tab for the course notes.
""" """
type = 'notes' type = 'notes'
title = _("My Notes") title = ugettext_noop("My Notes")
view_name = "notes" view_name = "notes"
@classmethod @classmethod
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
Definition of the course team feature. Definition of the course team feature.
""" """
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext_noop
from courseware.tabs import EnrolledTab from courseware.tabs import EnrolledTab
from .views import is_feature_enabled from .views import is_feature_enabled
...@@ -13,7 +13,7 @@ class TeamsTab(EnrolledTab): ...@@ -13,7 +13,7 @@ class TeamsTab(EnrolledTab):
""" """
type = "teams" type = "teams"
title = _("Teams") title = ugettext_noop("Teams")
view_name = "teams_dashboard" view_name = "teams_dashboard"
@classmethod @classmethod
......
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