From d99cef46763dbc6dee498e311671900296a2e5cb Mon Sep 17 00:00:00 2001 From: Cristian Salamea Date: Wed, 11 Dec 2013 15:27:14 -0500 Subject: [PATCH 1/4] i18n to level of education in student model --- common/djangoapps/student/models.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/common/djangoapps/student/models.py b/common/djangoapps/student/models.py index 935abbdd2e56..791948e5ff2f 100644 --- a/common/djangoapps/student/models.py +++ b/common/djangoapps/student/models.py @@ -25,6 +25,7 @@ import django.dispatch from django.forms import ModelForm, forms from django.core.exceptions import ObjectDoesNotExist +from django.utils.translation import ugettext as _ from course_modes.models import CourseMode import lms.lib.comment_client as cc @@ -196,15 +197,15 @@ class Meta: # ('p_se', 'Doctorate in science or engineering'), # ('p_oth', 'Doctorate in another field'), LEVEL_OF_EDUCATION_CHOICES = ( - ('p', 'Doctorate'), - ('m', "Master's or professional degree"), - ('b', "Bachelor's degree"), - ('a', "Associate's degree"), - ('hs', "Secondary/high school"), - ('jhs', "Junior secondary/junior high/middle school"), - ('el', "Elementary/primary school"), - ('none', "None"), - ('other', "Other") + ('p', _('Doctorate')), + ('m', _("Master's or professional degree")), + ('b', _("Bachelor's degree")), + ('a', _("Associate's degree")), + ('hs', _("Secondary/high school")), + ('jhs', _("Junior secondary/junior high/middle school")), + ('el', _("Elementary/primary school")), + ('none', _("None")), + ('other', _("Other")) ) level_of_education = models.CharField( blank=True, null=True, max_length=6, db_index=True, From 7f9cfdaa56ef3eb5ac88168a31765a0d600fac6e Mon Sep 17 00:00:00 2001 From: Cristian Salamea Date: Thu, 12 Dec 2013 09:42:41 -0500 Subject: [PATCH 2/4] Added checklist default values to be translated --- common/lib/xmodule/xmodule/course_module.py | 126 ++++++++++---------- 1 file changed, 64 insertions(+), 62 deletions(-) diff --git a/common/lib/xmodule/xmodule/course_module.py b/common/lib/xmodule/xmodule/course_module.py index 0ddd27d20251..c93f9f3323d4 100644 --- a/common/lib/xmodule/xmodule/course_module.py +++ b/common/lib/xmodule/xmodule/course_module.py @@ -8,6 +8,8 @@ import dateutil.parser from lazy import lazy +from django.utils.translation import ugettext as _ + from xmodule.modulestore import Location from xmodule.seq_module import SequenceDescriptor, SequenceModule from xmodule.graders import grader_from_conf @@ -227,132 +229,132 @@ class CourseFields(object): has_children = True checklists = List(scope=Scope.settings, default=[ - {"short_description": "Getting Started With Studio", - "items": [{"short_description": "Add Course Team Members", - "long_description": "Grant your collaborators permission to edit your course so you can work together.", + {"short_description": _("Getting Started With Studio"), + "items": [{"short_description": _("Add Course Team Members"), + "long_description": _("Grant your collaborators permission to edit your course so you can work together."), "is_checked": False, "action_url": "ManageUsers", - "action_text": "Edit Course Team", + "action_text": _("Edit Course Team"), "action_external": False}, - {"short_description": "Set Important Dates for Your Course", - "long_description": "Establish your course's student enrollment and launch dates on the Schedule and Details page.", + {"short_description": _("Set Important Dates for Your Course"), + "long_description": _("Establish your course's student enrollment and launch dates on the Schedule and Details page."), "is_checked": False, "action_url": "SettingsDetails", - "action_text": "Edit Course Details & Schedule", + "action_text": _("Edit Course Details & Schedule"), "action_external": False}, - {"short_description": "Draft Your Course's Grading Policy", - "long_description": "Set up your assignment types and grading policy even if you haven't created all your assignments.", + {"short_description": _("Draft Your Course's Grading Policy"), + "long_description": _("Set up your assignment types and grading policy even if you haven't created all your assignments."), "is_checked": False, "action_url": "SettingsGrading", - "action_text": "Edit Grading Settings", + "action_text": _("Edit Grading Settings"), "action_external": False}, - {"short_description": "Explore the Other Studio Checklists", - "long_description": "Discover other available course authoring tools, and find help when you need it.", + {"short_description": _("Explore the Other Studio Checklists"), + "long_description": _("Discover other available course authoring tools, and find help when you need it."), "is_checked": False, "action_url": "", "action_text": "", "action_external": False}]}, - {"short_description": "Draft a Rough Course Outline", - "items": [{"short_description": "Create Your First Section and Subsection", - "long_description": "Use your course outline to build your first Section and Subsection.", + {"short_description": _("Draft a Rough Course Outline"), + "items": [{"short_description": _("Create Your First Section and Subsection"), + "long_description": _("Use your course outline to build your first Section and Subsection."), "is_checked": False, "action_url": "CourseOutline", - "action_text": "Edit Course Outline", + "action_text": _("Edit Course Outline"), "action_external": False}, - {"short_description": "Set Section Release Dates", - "long_description": "Specify the release dates for each Section in your course. Sections become visible to students on their release dates.", + {"short_description": _("Set Section Release Dates"), + "long_description": _("Specify the release dates for each Section in your course. Sections become visible to students on their release dates."), "is_checked": False, "action_url": "CourseOutline", - "action_text": "Edit Course Outline", + "action_text": _("Edit Course Outline"), "action_external": False}, - {"short_description": "Designate a Subsection as Graded", - "long_description": "Set a Subsection to be graded as a specific assignment type. Assignments within graded Subsections count toward a student's final grade.", + {"short_description": _("Designate a Subsection as Graded"), + "long_description": _("Set a Subsection to be graded as a specific assignment type. Assignments within graded Subsections count toward a student's final grade."), "is_checked": False, "action_url": "CourseOutline", - "action_text": "Edit Course Outline", + "action_text": _("Edit Course Outline"), "action_external": False}, - {"short_description": "Reordering Course Content", - "long_description": "Use drag and drop to reorder the content in your course.", + {"short_description": _("Reordering Course Content"), + "long_description": _("Use drag and drop to reorder the content in your course."), "is_checked": False, "action_url": "CourseOutline", - "action_text": "Edit Course Outline", + "action_text": _("Edit Course Outline"), "action_external": False}, - {"short_description": "Renaming Sections", - "long_description": "Rename Sections by clicking the Section name from the Course Outline.", + {"short_description": _("Renaming Sections"), + "long_description": _("Rename Sections by clicking the Section name from the Course Outline."), "is_checked": False, "action_url": "CourseOutline", - "action_text": "Edit Course Outline", + "action_text": _("Edit Course Outline"), "action_external": False}, - {"short_description": "Deleting Course Content", - "long_description": "Delete Sections, Subsections, or Units you don't need anymore. Be careful, as there is no Undo function.", + {"short_description": _("Deleting Course Content"), + "long_description": _("Delete Sections, Subsections, or Units you don't need anymore. Be careful, as there is no Undo function."), "is_checked": False, "action_url": "CourseOutline", - "action_text": "Edit Course Outline", + "action_text": _("Edit Course Outline"), "action_external": False}, - {"short_description": "Add an Instructor-Only Section to Your Outline", - "long_description": "Some course authors find using a section for unsorted, in-progress work useful. To do this, create a section and set the release date to the distant future.", + {"short_description": _("Add an Instructor-Only Section to Your Outline"), + "long_description": _("Some course authors find using a section for unsorted, in-progress work useful. To do this, create a section and set the release date to the distant future."), "is_checked": False, "action_url": "CourseOutline", - "action_text": "Edit Course Outline", + "action_text": _("Edit Course Outline"), "action_external": False}]}, - {"short_description": "Explore edX's Support Tools", - "items": [{"short_description": "Explore the Studio Help Forum", - "long_description": "Access the Studio Help forum from the menu that appears when you click your user name in the top right corner of Studio.", + {"short_description": _("Explore edX's Support Tools"), + "items": [{"short_description": _("Explore the Studio Help Forum"), + "long_description": _("Access the Studio Help forum from the menu that appears when you click your user name in the top right corner of Studio."), "is_checked": False, "action_url": "http://help.edge.edx.org/", - "action_text": "Visit Studio Help", + "action_text": _("Visit Studio Help"), "action_external": True}, - {"short_description": "Enroll in edX 101", - "long_description": "Register for edX 101, edX's primer for course creation.", + {"short_description": _("Enroll in edX 101"), + "long_description": _("Register for edX 101, edX's primer for course creation."), "is_checked": False, - "action_url": "https://edge.edx.org/courses/edX/edX101/How_to_Create_an_edX_Course/about", - "action_text": "Register for edX 101", + "action_url": _("https://edge.edx.org/courses/edX/edX101/How_to_Create_an_edX_Course/about"), + "action_text": _("Register for edX 101"), "action_external": True}, - {"short_description": "Download the Studio Documentation", - "long_description": "Download the searchable Studio reference documentation in PDF form.", + {"short_description": _("Download the Studio Documentation"), + "long_description": _("Download the searchable Studio reference documentation in PDF form."), "is_checked": False, "action_url": "http://files.edx.org/Getting_Started_with_Studio.pdf", - "action_text": "Download Documentation", + "action_text": _("Download Documentation"), "action_external": True}]}, - {"short_description": "Draft Your Course About Page", - "items": [{"short_description": "Draft a Course Description", - "long_description": "Courses on edX have an About page that includes a course video, description, and more. Draft the text students will read before deciding to enroll in your course.", + {"short_description": _("Draft Your Course About Page"), + "items": [{"short_description": _("Draft a Course Description"), + "long_description": _("Courses on edX have an About page that includes a course video, description, and more. Draft the text students will read before deciding to enroll in your course."), "is_checked": False, "action_url": "SettingsDetails", - "action_text": "Edit Course Schedule & Details", + "action_text": _("Edit Course Schedule & Details"), "action_external": False}, - {"short_description": "Add Staff Bios", - "long_description": "Showing prospective students who their instructor will be is helpful. Include staff bios on the course About page.", + {"short_description": _("Add Staff Bios"), + "long_description": _("Showing prospective students who their instructor will be is helpful. Include staff bios on the course About page."), "is_checked": False, "action_url": "SettingsDetails", - "action_text": "Edit Course Schedule & Details", + "action_text": _("Edit Course Schedule & Details"), "action_external": False}, - {"short_description": "Add Course FAQs", - "long_description": "Include a short list of frequently asked questions about your course.", + {"short_description": _("Add Course FAQs"), + "long_description": _("Include a short list of frequently asked questions about your course."), "is_checked": False, "action_url": "SettingsDetails", - "action_text": "Edit Course Schedule & Details", + "action_text": _("Edit Course Schedule & Details"), "action_external": False}, - {"short_description": "Add Course Prerequisites", - "long_description": "Let students know what knowledge and/or skills they should have before they enroll in your course.", + {"short_description": _("Add Course Prerequisites"), + "long_description": _("Let students know what knowledge and/or skills they should have before they enroll in your course."), "is_checked": False, "action_url": "SettingsDetails", - "action_text": "Edit Course Schedule & Details", + "action_text": _("Edit Course Schedule & Details"), "action_external": False}]} ]) info_sidebar_name = String(scope=Scope.settings, default='Course Handouts') show_timezone = Boolean( - help="True if timezones should be shown on dates in the courseware. Deprecated in favor of due_date_display_format.", + help=_("True if timezones should be shown on dates in the courseware. Deprecated in favor of due_date_display_format."), scope=Scope.settings, default=True ) due_date_display_format = String( - help="Format supported by strftime for displaying due dates. Takes precedence over show_timezone.", + help=_("Format supported by strftime for displaying due dates. Takes precedence over show_timezone."), scope=Scope.settings, default=None ) - enrollment_domain = String(help="External login method associated with user accounts allowed to register in course", + enrollment_domain = String(help=_("External login method associated with user accounts allowed to register in course"), scope=Scope.settings) course_image = String( - help="Filename of the course image", + help=_("Filename of the course image"), scope=Scope.settings, # Ensure that courses imported from XML keep their image default="images_course_image.jpg" From c28397e9f8b53bafd477a248de595d5d964a07bc Mon Sep 17 00:00:00 2001 From: Cristian Salamea Date: Thu, 12 Dec 2013 14:20:52 -0500 Subject: [PATCH 3/4] Fix url translation --- common/lib/xmodule/xmodule/course_module.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/lib/xmodule/xmodule/course_module.py b/common/lib/xmodule/xmodule/course_module.py index c93f9f3323d4..c22eb5e4cb50 100644 --- a/common/lib/xmodule/xmodule/course_module.py +++ b/common/lib/xmodule/xmodule/course_module.py @@ -307,7 +307,7 @@ class CourseFields(object): {"short_description": _("Enroll in edX 101"), "long_description": _("Register for edX 101, edX's primer for course creation."), "is_checked": False, - "action_url": _("https://edge.edx.org/courses/edX/edX101/How_to_Create_an_edX_Course/about"), + "action_url": "https://edge.edx.org/courses/edX/edX101/How_to_Create_an_edX_Course/about", "action_text": _("Register for edX 101"), "action_external": True}, {"short_description": _("Download the Studio Documentation"), From 149f0fc078c29a35023767aaf2d8a17d568d1925 Mon Sep 17 00:00:00 2001 From: Cristian Salamea Date: Fri, 13 Dec 2013 08:56:34 -0500 Subject: [PATCH 4/4] Added myself as contributor in AUTHORS --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index 4b0b07f91f65..e484f0e02bfa 100644 --- a/AUTHORS +++ b/AUTHORS @@ -100,3 +100,4 @@ Manuel Freire Daniel Cebrián Robles Carson Gee Gang Chen +Cristian Salamea