From 9a352b9125eb90ab0f0ae9414965afef524327ad Mon Sep 17 00:00:00 2001
From: Sarina Canelake
Date: Sun, 6 Apr 2014 19:05:18 -0400
Subject: [PATCH] Unicode support for course names in reverification flow
---
lms/static/js/Markdown.Editor.js | 8 ++++++--
lms/templates/contact.html | 14 +++++++-------
.../courseware/courseware-error.html | 4 ++--
.../_dashboard_prompt_midcourse_reverify.html | 19 ++++++++++++++-----
lms/templates/enroll_students.html | 5 -----
lms/templates/help_modal.html | 6 +++++-
lms/templates/module-error.html | 4 ++--
lms/templates/signup_modal.html | 18 +++++++++---------
.../static_templates/server-down.html | 4 ++--
.../static_templates/server-error.html | 14 +++++++++-----
.../static_templates/server-overloaded.html | 4 ++--
11 files changed, 58 insertions(+), 42 deletions(-)
diff --git a/lms/static/js/Markdown.Editor.js b/lms/static/js/Markdown.Editor.js
index e28c211d7b..abcd95f5a2 100644
--- a/lms/static/js/Markdown.Editor.js
+++ b/lms/static/js/Markdown.Editor.js
@@ -27,8 +27,12 @@
// The text that appears on the upper part of the dialog box when
// entering links.
- var linkDialogText = "" + gettext("Insert Hyperlink") + "
http://example.com/ " + gettext("\"optional title\"") + "
";
- var imageDialogText = "" + gettext("Insert Image (upload file or type url)") + "
http://example.com/images/diagram.jpg " + gettext("\"optional title\"") + "
";
+ var linkDialogText = "" + gettext("Insert Hyperlink") + "
http://example.com/ " +
+ // Translators: Please keep the quotation marks (") around this text
+ gettext("\"optional title\"") + "
";
+ var imageDialogText = "" + gettext("Insert Image (upload file or type url)") + "
http://example.com/images/diagram.jpg " +
+ // Translators: Please keep the quotation marks (") around this text
+ gettext("\"optional title\"") + "
";
// The default text that appears in the dialog input box when entering
// links.
diff --git a/lms/templates/contact.html b/lms/templates/contact.html
index 4b73900806..6bbfc43daa 100644
--- a/lms/templates/contact.html
+++ b/lms/templates/contact.html
@@ -28,8 +28,8 @@
'discussion on our {fb_link_start}facebook page{fb_link_end}. Though we may '
'not have a chance to respond to every email, we take all feedback into consideration.').format(
platform_name=settings.PLATFORM_NAME,
- contact_email='{0}'.format(settings.CONTACT_EMAIL),
- faq_link_start=''.format(url=reverse('faq_edx')),
+ contact_email=u'{0}'.format(settings.CONTACT_EMAIL),
+ faq_link_start=u''.format(url=reverse('faq_edx')),
faq_link_end='',
fb_link_start='',
fb_link_end=''
@@ -44,23 +44,23 @@
'please make sure you are using a current version of Firefox or Chrome, and include '
'browser and version in your e-mail, as well as screenshots or other pertinent details. '
'If you find a bug or other issues, you can reach us at the following: {bugs_email}.').format(
- tech_email='{0}'.format(settings.TECH_SUPPORT_EMAIL),
- bug_email='{0}'.format(settings.BUGS_EMAIL),
+ tech_email=u'{0}'.format(settings.TECH_SUPPORT_EMAIL),
+ bug_email=u'{0}'.format(settings.BUGS_EMAIL),
platform_name=settings.PLATFORM_NAME
)}
${_("Media")}
${_('Please visit our {link_start}media/press page{link_end} for more information. For any media or press inquiries, please email {email}.').format(
- link_start=''.format(url=reverse('faq_edx')),
+ link_start=u''.format(url=reverse('faq_edx')),
link_end='',
- email='press@edx.org',
+ email=u'press@edx.org',
)}
${_("Universities")}
${_('If you are a university wishing to collaborate with or if you have questions about {platform_name}, please email {email}.').format(
- email='university@edx.org',
+ email=u'university@edx.org',
platform_name=settings.PLATFORM_NAME
)}
diff --git a/lms/templates/courseware/courseware-error.html b/lms/templates/courseware/courseware-error.html
index 38754aeeb4..8829ba3811 100644
--- a/lms/templates/courseware/courseware-error.html
+++ b/lms/templates/courseware/courseware-error.html
@@ -15,13 +15,13 @@
${_('There has been an error on the {platform_name} servers').format(
- platform_name='{}'.format(settings.PLATFORM_NAME)
+ platform_name=u'{}'.format(settings.PLATFORM_NAME)
)}
${_("We're sorry, this module is temporarily unavailable. Our staff is working to fix "
"it as soon as possible. Please email us at {tech_support_email}' to report any problems or downtime.").format(
- tech_support_email='{0}'.format(settings.TECH_SUPPORT_EMAIL)
+ tech_support_email=u'{0}'.format(settings.TECH_SUPPORT_EMAIL)
)}
diff --git a/lms/templates/dashboard/_dashboard_prompt_midcourse_reverify.html b/lms/templates/dashboard/_dashboard_prompt_midcourse_reverify.html
index 8e200db401..c77f8d9e3f 100644
--- a/lms/templates/dashboard/_dashboard_prompt_midcourse_reverify.html
+++ b/lms/templates/dashboard/_dashboard_prompt_midcourse_reverify.html
@@ -15,7 +15,10 @@
% for item in reverifications["must_reverify"]:
-
- ${_('{course_name}: Re-verify by {date}').format(course_name="item.course_name", date=item.date)}
+ ${_('{course_name}: Re-verify by {date}').format(
+ course_name=u"{0}".format(item.course_name),
+ date=item.date
+ )}
% endfor
@@ -39,7 +42,10 @@
% for item in reverifications["must_reverify"]:
- ${_('To continue in the ID Verified track in {course_name}, you need to re-verify your identity by {date}.').format(course_name="" + item.course_name + "", date=item.date)}
+ ${_('To continue in the ID Verified track in {course_name}, you need to re-verify your identity by {date}.').format(
+ course_name=u"{}".format(item.course_name),
+ date=item.date
+ )}
@@ -65,9 +71,12 @@
% if item.display:
- ${_('Your re-verification for {course_name} failed and you are no longer eligible for a Verified Certificate. If you think this is in error, please contact us at {email}.').format(course_name="" + item.course_name+ "", email='{email}'.format(
- email=billing_email
- ))}
+ ${_('Your re-verification for {course_name} failed and you are no longer eligible for a Verified Certificate. If you think this is in error, please contact us at {email}.').format(
+ course_name=u"{}".format(item.course_name),
+ email=u'{email}'.format(
+ email=billing_email
+ )
+ )}
diff --git a/lms/templates/enroll_students.html b/lms/templates/enroll_students.html
index 9ffaa8c1bf..5d3e2f798a 100644
--- a/lms/templates/enroll_students.html
+++ b/lms/templates/enroll_students.html
@@ -24,8 +24,3 @@ ${ rejected_students }
${_("Debug: ")}
${ debug }
-
-
-
"foo"
-
"bar"
-
"biff"
diff --git a/lms/templates/help_modal.html b/lms/templates/help_modal.html
index cdbe3d2ca8..195cb9d903 100644
--- a/lms/templates/help_modal.html
+++ b/lms/templates/help_modal.html
@@ -27,7 +27,11 @@
- ${_('{platform_name} Help').format(platform_name='{}'.format(platform_name))}
+
+ ${_('{platform_name} Help').format(
+ platform_name=u'{}'.format(platform_name)
+ )}
+
diff --git a/lms/templates/module-error.html b/lms/templates/module-error.html
index 4d2b2a8e95..45ad4e4512 100644
--- a/lms/templates/module-error.html
+++ b/lms/templates/module-error.html
@@ -3,14 +3,14 @@
${_("There has been an error on the {platform_name} servers").format(
- platform_name="{}".format(settings.PLATFORM_NAME)
+ platform_name=u"{}".format(settings.PLATFORM_NAME)
)}
${_("We're sorry, this module is temporarily unavailable. Our staff is working "
"to fix it as soon as possible. Please email us at {tech_support_email} to "
"report any problems or downtime.").format(
- tech_support_email="{0}".format(settings.TECH_SUPPORT_EMAIL)
+ tech_support_email=u"{0}".format(settings.TECH_SUPPORT_EMAIL)
)}
diff --git a/lms/templates/signup_modal.html b/lms/templates/signup_modal.html
index 569f6ea722..efe2622f6f 100644
--- a/lms/templates/signup_modal.html
+++ b/lms/templates/signup_modal.html
@@ -22,7 +22,7 @@
${_('Sign Up for {platform_name}').format(
- platform_name='{}'.format(settings.PLATFORM_NAME)
+ platform_name=u'{}'.format(settings.PLATFORM_NAME)
)}
@@ -35,26 +35,26 @@
diff --git a/lms/templates/static_templates/server-down.html b/lms/templates/static_templates/server-down.html
index 528e76ed94..3ff617e00d 100644
--- a/lms/templates/static_templates/server-down.html
+++ b/lms/templates/static_templates/server-down.html
@@ -4,12 +4,12 @@
${_("Currently the {platform_name} servers are down").format(
- platform_name="{}".format(settings.PLATFORM_NAME)
+ platform_name=u"{}".format(settings.PLATFORM_NAME)
)}
${_("Our staff is currently working to get the site back up as soon as possible. "
"Please email us at {tech_support_email} to report any problems or downtime.").format(
- tech_support_email="{0}".format(settings.TECH_SUPPORT_EMAIL)
+ tech_support_email=u"{0}".format(settings.TECH_SUPPORT_EMAIL)
)}
diff --git a/lms/templates/static_templates/server-error.html b/lms/templates/static_templates/server-error.html
index ee0fd2db92..cf5d79c7ce 100644
--- a/lms/templates/static_templates/server-error.html
+++ b/lms/templates/static_templates/server-error.html
@@ -2,12 +2,16 @@
<%inherit file="../main.html" />
- ${_(u"There has been a 500 error on the {platform_name} servers").format(
- platform_name="{}".format(platform_name=settings.PLATFORM_NAME)
- )}
- ${_(u'Please wait a few seconds and then reload the page. If the problem persists, please email us at {email}.').format(
+
+ ${_(u"There has been a 500 error on the {platform_name} servers").format(
+ platform_name=u"{}".format(platform_name=settings.PLATFORM_NAME)
+ )}
+
+
+ ${_(u'Please wait a few seconds and then reload the page. If the problem persists, please email us at {email}.').format(
email=u'{email}'.format(
email=settings.TECH_SUPPORT_EMAIL
)
- )}
+ )}
+
diff --git a/lms/templates/static_templates/server-overloaded.html b/lms/templates/static_templates/server-overloaded.html
index 76593ecb0f..e08317f3b4 100644
--- a/lms/templates/static_templates/server-overloaded.html
+++ b/lms/templates/static_templates/server-overloaded.html
@@ -4,13 +4,13 @@
${_("Currently the {platform_name} servers are overloaded").format(
- platform_name="{}".format(platform_name=settings.PLATFORM_NAME)
+ platform_name=u"{}".format(platform_name=settings.PLATFORM_NAME)
)}
${_("Our staff is currently working to get the site back up as soon as possible. "
"Please email us at {tech_support_email} to report any problems or downtime.").format(
- tech_support_email="{0}".format(tech_support_email=settings.TECH_SUPPORT_EMAIL)
+ tech_support_email=u"{0}".format(tech_support_email=settings.TECH_SUPPORT_EMAIL)
)}