From 71d5180ba10ff8cd3b4023e672e5f37bcc7169b1 Mon Sep 17 00:00:00 2001 From: Sarina Canelake Date: Tue, 4 Aug 2015 14:25:16 -0400 Subject: [PATCH] Add more context to translation strings --- .../static/teams/js/collections/topic.js | 1 + lms/templates/courseware/progress.html | 8 +++-- .../credit_eligibility_email.html | 26 +++++++++------ .../dashboard/_dashboard_credit_info.html | 32 +++++++++++-------- 4 files changed, 41 insertions(+), 26 deletions(-) diff --git a/lms/djangoapps/teams/static/teams/js/collections/topic.js b/lms/djangoapps/teams/static/teams/js/collections/topic.js index 83dedd8941..538e339762 100644 --- a/lms/djangoapps/teams/static/teams/js/collections/topic.js +++ b/lms/djangoapps/teams/static/teams/js/collections/topic.js @@ -13,6 +13,7 @@ delete this.server_api['sort_order']; // Sort order is not specified for the Team API this.registerSortableField('name', gettext('name')); + // Translators: This refers to the number of teams (a count of how many teams there are) this.registerSortableField('team_count', gettext('team count')); }, diff --git a/lms/templates/courseware/progress.html b/lms/templates/courseware/progress.html index 0fa64263eb..564ded6c8c 100644 --- a/lms/templates/courseware/progress.html +++ b/lms/templates/courseware/progress.html @@ -75,6 +75,7 @@ from django.utils.http import urlquote_plus %elif is_generating:
+ # Translators: This message appears to users when the system is processessing course certificates, which can take a few hours.

${_("We're working on it...")}

${_("We're creating your certificate. You can keep working in your courses and a link to it will appear here and on your Dashboard when it is ready.")}

@@ -108,7 +109,10 @@ from django.utils.http import urlquote_plus ${_("{student_name}, you are no longer eligible for credit in this course.").format(student_name=student.profile.name)} %elif credit_course_requirements['eligibility_status'] == 'eligible': ${_("{student_name}, you have met the requirements for credit in this course.").format(student_name=student.profile.name)} - ${_("{link} to purchase course credit.").format(link="{url_name}".format(url = reverse('dashboard'), url_name = _('Go to your dashboard')))} + ${_("{a_start}Go to your dashboard{a_end} to purchase course credit.").format( + a_start=u"".format(url=reverse('dashboard')), + a_end="" + )} %elif credit_course_requirements['eligibility_status'] == 'partial_eligible': ${_("{student_name}, you have not yet met the requirements for credit.").format(student_name=student.profile.name)} @@ -173,7 +177,7 @@ from django.utils.http import urlquote_plus ${ section['display_name'] } %if total > 0 or earned > 0: - ${_("{earned:.3n} of {total:.3n} possible points").format( earned = float(earned), total = float(total) )} + ${_("{earned} of {total} possible points").format(earned='{:.3n}'.format(float(earned)), total='{:.3n}'.format(float(total)))} %endif diff --git a/lms/templates/credit_notifications/credit_eligibility_email.html b/lms/templates/credit_notifications/credit_eligibility_email.html index 1d05b71fd1..df7ea282b8 100644 --- a/lms/templates/credit_notifications/credit_eligibility_email.html +++ b/lms/templates/credit_notifications/credit_eligibility_email.html @@ -30,10 +30,12 @@

- ${_(u"Congratulations! You are eligible to receive course credit for successfully completing your edX course! Click {link} to get your credit now.").format( - link=u'here'.format( + ${_(u"Congratulations! You are eligible to receive course credit for successfully completing your {platform_name} course! {link_start}Get your credit now.{link_end}").format( + link_start=u''.format( dashboard_url=dashboard_link - ) + ), + link_end=u'', + platform_name=settings.PLATFORM_NAME )}

@@ -42,16 +44,18 @@

- ${_(u'To get course credit, simply go to your {link} and click the Get Credit button. No application, transcript, or grade report is required.').format( - link=u'edX dashboard'.format( + ${_(u'To get course credit, simply go to your {link_start}{platform_name} dashboard{link_end} and click the Get Credit button. No application, transcript, or grade report is required.').format( + link_start=u''.format( dashboard_url=dashboard_link - ) + ), + link_end=u'', + platform_name=settings.PLATFORM_NAME )}

- ${_(u"We hope you enjoyed the course, and we hope to see you in future edX courses!")}
- ${_(u"The edX team")} + ${_(u"We hope you enjoyed the course, and we hope to see you in future {platform_name} courses!").format(platform_name=settings.PLATFORM_NAME)}
+ ${_(u"The {platform_name} Team").format(platform_name=settings.PLATFORM_NAME)}

@@ -61,8 +65,10 @@

- ${_(u"For more information on credit at edX, click {link}.").format( - link=u'here' + ${_(u"{link_start}Click here for more information on credit at {platform_name}{link_end}.").format( + link_start=u'', + link_end=u'', + platform_name=settings.PLATFORM_NAME )}

diff --git a/lms/templates/dashboard/_dashboard_credit_info.html b/lms/templates/dashboard/_dashboard_credit_info.html index 2b4f1a459c..2b47712de7 100644 --- a/lms/templates/dashboard/_dashboard_credit_info.html +++ b/lms/templates/dashboard/_dashboard_credit_info.html @@ -7,7 +7,7 @@ %> <%namespace name='static' file='../static_content.html'/> % if credit_status["provider_name"]: - <% provider_link='{}'.format(credit_status["provider_status_url"],credit_status["provider_name"]) %> + <% provider_link='{}'.format(credit_status["provider_status_url"], credit_status["provider_name"]) %> % endif % if credit_status["eligible"]: @@ -21,10 +21,7 @@

% if not credit_status["purchased"] and not credit_status["error"] :

- ${_("You are now eligible for credit. {congrats}").format( - congrats="Congratulations", - ) - } + ${_("You are now eligible for credit. Congratulations!")}

${_("Get credit")} @@ -32,16 +29,20 @@ % elif credit_status["request_status"] in [None, "pending"] and not credit_status["error"] : % if credit_status["request_status"] == "pending":

- ${_("Thank you. Your credit is processing. Please see {link} for more information.").format( - link=provider_link, + ## Translators: link_to_provider_site is a link to an external webpage. The text of the link will be the name of a + ## credit provider, such as 'State University' or 'Happy Fun Company' + ${_("Thank you. Your credit is processing. Please see {link_to_provider_site} for more information.").format( + link_to_provider_site=provider_link, ) }

% elif credit_status["request_status"] is None:

- ${_("Thank you for your purchase. Please proceed to {link} to finalize your credit.").format( - link=provider_link, + ## Translators: link_to_provider_site is a link to an external webpage. The text of the link will be the name of a + ## credit provider, such as 'State University' or 'Happy Fun Company' + ${_("Thank you for your purchase. Please proceed to {link_to_provider_site} to finalize your credit.").format( + link_to_provider_site=provider_link, ) }

@@ -51,17 +52,20 @@
% elif credit_status["request_status"] == "approved" and not credit_status["error"] :

- ${_("Your credit has been processed and approved. {congrats}. Please see {link} for more information.").format( - congrats="Congratulations", - link=provider_link, + ## Translators: link_to_provider_site is a link to an external webpage. The text of the link will be the name of a + ## credit provider, such as 'State University' or 'Happy Fun Company' + ${_("Your credit has been processed and approved. Congratulations. Please see {link_to_provider_site} for more information.").format( + link_to_provider_site=provider_link, ) }

${_("Access credit")} % elif credit_status["request_status"] == "rejected" and not credit_status["error"] :

- ${_("Your credit has been processed but denied. Please contact {link} for more information.").format( - link=provider_link, + ## Translators: link_to_provider_site is a link to an external webpage. The text of the link will be the name of a + ## credit provider, such as 'State University' or 'Happy Fun Company' + ${_("Your credit has been processed but denied. Please contact {link_to_provider_site} for more information.").format( + link_to_provider_site=provider_link, ) }