Merge pull request #17086 from edx/diana/i18n-sock

Mark sock strings for translation.
This commit is contained in:
Diana Huang
2018-01-04 11:29:15 -05:00
committed by GitHub
2 changed files with 35 additions and 33 deletions

View File

@@ -4,7 +4,8 @@
<%namespace name='static' file='../static_content.html'/> <%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 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 %endif
> >
<button type="button" class="btn btn-primary focusable action-toggle-verification-sock"> <button type="button" class="btn btn-primary focusable action-toggle-verification-sock">
Learn About Verified Certificates ${_('Learn About Verified Certificates')}
</button> </button>
<div class="verification-main-panel"> <div class="verification-main-panel">
<div class="verification-desc-panel content-main"> <div class="verification-desc-panel content-main">
<h2>edX Verified Certificate</h2> <h2>${_('{platform_name} Verified Certificate').format(platform_name=settings.PLATFORM_NAME)}</h2>
<h4>Why upgrade?</h4> <h4>${_('Why upgrade?')}</h4>
<ul> <ul>
<li>Official proof of completion</li> <li>${_('Official proof of completion')}</li>
<li>Easily shareable certificate</li> <li>${_('Easily shareable certificate')}</li>
<li>Proven motivator to complete the course</li> <li>${_('Proven motivator to complete the course')}</li>
<li>Certificate purchases help edX continue to offer free courses</li> <li>${_('Certificate purchases help {platform_name} continue to offer free courses').format(platform_name=settings.PLATFORM_NAME)}</li>
</ul> </ul>
<h4>How it works</h4> <h4>${_('How it works')}</h4>
<ul> <ul>
<li>Pay the Verified Certificate upgrade fee</li> <li>${_('Pay the Verified Certificate upgrade fee')}</li>
<li>Verify your identity with a webcam and government-issued ID</li> <li>${_('Verify your identity with a webcam and government-issued ID')}</li>
<li>Study hard and pass the course</li> <li>${_('Study hard and pass the course')}</li>
<li>Share your certificate with friends, employers, and others</li> <li>${_('Share your certificate with friends, employers, and others')}</li>
</ul> </ul>
<h4>edX Learner Stories</h4> % if settings.PLATFORM_NAME == 'edX':
<div class="learner-story-container"> <h4>${_('edX Learner Stories')}</h4>
<img class="student-image" alt="Student Image" src="${static.url('course_experience/images/learner-quote.png')}" /> <div class="learner-story-container">
<div class="story-quote"> <img class="student-image" alt="Student Image" src="${static.url('course_experience/images/learner-quote.png')}" />
My certificate has helped me showcase my knowledge on my <div class="story-quote">
resume - I feel like this certificate could really help me land ${_('My certificate has helped me showcase my knowledge on my \
my dream job! resume - I feel like this certificate could really help me land \
<span class="author">- Christina Fong, edX Learner</span> my dream job!')}
<span class="author">- ${_('{learner_name}, edX Learner').format(learner_name='Christina Fong')}</span>
</div>
</div> </div>
</div> <div class="learner-story-container">
<div class="learner-story-container"> <img class="student-image" alt="Student Image" src="${static.url('course_experience/images/learner-quote2.png')}" />
<img class="student-image" alt="Student Image" src="${static.url('course_experience/images/learner-quote2.png')}" /> <div class="story-quote">
<div class="story-quote"> ${_('I wanted to include a verified certificate on my resume and my profile to \
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 \
illustrate that I am working towards this goal I have and that I have achieved something while I was unemployed.')}<br/>
achieved something while I was unemployed.<br/> <span class="author">- ${_('{learner_name}, edX Learner').format(learner_name='Cheryl Troell')}</span>
<span class="author">- Cheryl Troell, edX Learner</span> </div>
</div> </div>
</div> % endif
<img class="mini-cert" src="${static.url('course_experience/images/verified-cert.png')}"/> <img class="mini-cert" src="${static.url('course_experience/images/verified-cert.png')}"/>
<a href="${upgrade_url}"> <a href="${upgrade_url}">
<button type="button" class="btn btn-upgrade stuck-top focusable action-upgrade-certificate" data-creative="original_sock" data-position="sock"> <button type="button" class="btn btn-upgrade stuck-top focusable action-upgrade-certificate" data-creative="original_sock" data-position="sock">
Upgrade (${HTML(course_price)}) ${Text(_('Upgrade ({course_price})')).format(course_price=HTML(course_price))}
</button> </button>
</a> </a>
</div> </div>

View File

@@ -2,7 +2,6 @@
Fragment for rendering the course's sock and associated toggle button. Fragment for rendering the course's sock and associated toggle button.
""" """
from django.template.loader import render_to_string from django.template.loader import render_to_string
from django.utils.translation import get_language
from web_fragments.fragment import Fragment from web_fragments.fragment import Fragment
from course_modes.models import get_cosmetic_verified_display_price from course_modes.models import get_cosmetic_verified_display_price
@@ -26,7 +25,7 @@ class CourseSockFragmentView(EdxFragmentView):
@staticmethod @staticmethod
def get_verification_context(request, course): def get_verification_context(request, course):
enrollment = CourseEnrollment.get_enrollment(request.user, course.id) 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: if show_course_sock:
upgrade_url = verified_upgrade_deadline_link(request.user, course=course) upgrade_url = verified_upgrade_deadline_link(request.user, course=course)
course_price = get_cosmetic_verified_display_price(course) course_price = get_cosmetic_verified_display_price(course)