From b4e7d350955d1c84adae7b11377a0a85e947e437 Mon Sep 17 00:00:00 2001 From: Diana Huang Date: Wed, 3 Jan 2018 15:36:31 -0500 Subject: [PATCH] Mark sock strings for translation. --- .../course-sock-fragment.html | 65 ++++++++++--------- .../course_experience/views/course_sock.py | 3 +- 2 files changed, 35 insertions(+), 33 deletions(-) diff --git a/openedx/features/course_experience/templates/course_experience/course-sock-fragment.html b/openedx/features/course_experience/templates/course_experience/course-sock-fragment.html index 54d61b7ba0..26555a01b5 100644 --- a/openedx/features/course_experience/templates/course_experience/course-sock-fragment.html +++ b/openedx/features/course_experience/templates/course_experience/course-sock-fragment.html @@ -4,7 +4,8 @@ <%namespace name='static' file='../static_content.html'/> <%! -from openedx.core.djangolib.markup import HTML +from django.utils.translation import ugettext as _ +from openedx.core.djangolib.markup import HTML, Text from openedx.features.course_experience import DISPLAY_COURSE_SOCK_FLAG %> @@ -16,48 +17,50 @@ from openedx.features.course_experience import DISPLAY_COURSE_SOCK_FLAG %endif >
-

edX Verified Certificate

-

Why upgrade?

+

${_('{platform_name} Verified Certificate').format(platform_name=settings.PLATFORM_NAME)}

+

${_('Why upgrade?')}

    -
  • Official proof of completion
  • -
  • Easily shareable certificate
  • -
  • Proven motivator to complete the course
  • -
  • Certificate purchases help edX continue to offer free courses
  • +
  • ${_('Official proof of completion')}
  • +
  • ${_('Easily shareable certificate')}
  • +
  • ${_('Proven motivator to complete the course')}
  • +
  • ${_('Certificate purchases help {platform_name} continue to offer free courses').format(platform_name=settings.PLATFORM_NAME)}
-

How it works

+

${_('How it works')}

    -
  • Pay the Verified Certificate upgrade fee
  • -
  • Verify your identity with a webcam and government-issued ID
  • -
  • Study hard and pass the course
  • -
  • Share your certificate with friends, employers, and others
  • +
  • ${_('Pay the Verified Certificate upgrade fee')}
  • +
  • ${_('Verify your identity with a webcam and government-issued ID')}
  • +
  • ${_('Study hard and pass the course')}
  • +
  • ${_('Share your certificate with friends, employers, and others')}
-

edX Learner Stories

-
- Student Image -
- My certificate has helped me showcase my knowledge on my - resume - I feel like this certificate could really help me land - my dream job! - - Christina Fong, edX Learner + % if settings.PLATFORM_NAME == 'edX': +

${_('edX Learner Stories')}

+
+ Student Image +
+ ${_('My certificate has helped me showcase my knowledge on my \ + resume - I feel like this certificate could really help me land \ + my dream job!')} + - ${_('{learner_name}, edX Learner').format(learner_name='Christina Fong')} +
-
-
- Student Image -
- I wanted to include a verified certificate on my resume and my profile to - illustrate that I am working towards this goal I have and that I have - achieved something while I was unemployed.
- - Cheryl Troell, edX Learner +
+ Student Image +
+ ${_('I wanted to include a verified certificate on my resume and my profile to \ + illustrate that I am working towards this goal I have and that I have \ + achieved something while I was unemployed.')}
+ - ${_('{learner_name}, edX Learner').format(learner_name='Cheryl Troell')} +
-
+ % endif
diff --git a/openedx/features/course_experience/views/course_sock.py b/openedx/features/course_experience/views/course_sock.py index d9c25e7724..461a0616c1 100644 --- a/openedx/features/course_experience/views/course_sock.py +++ b/openedx/features/course_experience/views/course_sock.py @@ -2,7 +2,6 @@ Fragment for rendering the course's sock and associated toggle button. """ from django.template.loader import render_to_string -from django.utils.translation import get_language from web_fragments.fragment import Fragment from course_modes.models import get_cosmetic_verified_display_price @@ -26,7 +25,7 @@ class CourseSockFragmentView(EdxFragmentView): @staticmethod def get_verification_context(request, course): enrollment = CourseEnrollment.get_enrollment(request.user, course.id) - show_course_sock = verified_upgrade_link_is_valid(enrollment) and get_language() == 'en' + show_course_sock = verified_upgrade_link_is_valid(enrollment) if show_course_sock: upgrade_url = verified_upgrade_deadline_link(request.user, course=course) course_price = get_cosmetic_verified_display_price(course)