From 9a352b9125eb90ab0f0ae9414965afef524327ad Mon Sep 17 00:00:00 2001
From: Sarina Canelake <sarina@edx.org>
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 e28c211d7b6..abcd95f5a29 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 = "<p><b>" + gettext("Insert Hyperlink") + "</b></p><p>http://example.com/ " + gettext("\"optional title\"") + "</p>";
-    var imageDialogText = "<p><b>" + gettext("Insert Image (upload file or type url)") + "</b></p><p>http://example.com/images/diagram.jpg " + gettext("\"optional title\"") + "<br><br></p>";
+    var linkDialogText = "<p><b>" + gettext("Insert Hyperlink") + "</b></p><p>http://example.com/ " +
+	// Translators: Please keep the quotation marks (") around this text
+	gettext("\"optional title\"") + "</p>";
+    var imageDialogText = "<p><b>" + gettext("Insert Image (upload file or type url)") + "</b></p><p>http://example.com/images/diagram.jpg " +
+	// Translators: Please keep the quotation marks (") around this text
+	gettext("\"optional title\"") + "<br><br></p>";
 
     // 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 4b739008064..6bbfc43daa1 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='<a href="mailto:{0}">{0}</a>'.format(settings.CONTACT_EMAIL),
-            faq_link_start='<a href="{url}">'.format(url=reverse('faq_edx')),
+            contact_email=u'<a href="mailto:{0}">{0}</a>'.format(settings.CONTACT_EMAIL),
+            faq_link_start=u'<a href="{url}">'.format(url=reverse('faq_edx')),
             faq_link_end='</a>',
             fb_link_start='<a href="http://www.facebook.com/EdxOnline">',
             fb_link_end='</a>'
@@ -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='<a href="mailto:{0}">{0}</a>'.format(settings.TECH_SUPPORT_EMAIL),
-            bug_email='<a href="mailto:{0}">{0}</a>'.format(settings.BUGS_EMAIL),
+            tech_email=u'<a href="mailto:{0}">{0}</a>'.format(settings.TECH_SUPPORT_EMAIL),
+            bug_email=u'<a href="mailto:{0}">{0}</a>'.format(settings.BUGS_EMAIL),
             platform_name=settings.PLATFORM_NAME
 	)}
       </p>
 
       <h2>${_("Media")}</h2>
       <p>${_('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='<a href="{url}">'.format(url=reverse('faq_edx')),
+        link_start=u'<a href="{url}">'.format(url=reverse('faq_edx')),
         link_end='</a>',
-        email='<a href="mailto:press@edx.org">press@edx.org</a>',
+        email=u'<a href="mailto:press@edx.org">press@edx.org</a>',
         )}</p>
 
       <h2>${_("Universities")}</h2>
       <p>
 	${_('If you are a university wishing to collaborate with or if you have questions about {platform_name}, please email {email}.').format(
-	    email='<a href="mailto:university@edx.org">university@edx.org</a>',
+	    email=u'<a href="mailto:university@edx.org">university@edx.org</a>',
     	    platform_name=settings.PLATFORM_NAME
 	)}
       </p>
diff --git a/lms/templates/courseware/courseware-error.html b/lms/templates/courseware/courseware-error.html
index 38754aeeb4a..8829ba3811e 100644
--- a/lms/templates/courseware/courseware-error.html
+++ b/lms/templates/courseware/courseware-error.html
@@ -15,13 +15,13 @@
   <section class="outside-app">
     <h1>
       ${_('There has been an error on the {platform_name} servers').format(
-          platform_name='<span class="edx">{}</span>'.format(settings.PLATFORM_NAME)
+          platform_name=u'<span class="edx">{}</span>'.format(settings.PLATFORM_NAME)
       )}
     </h1>
     <p>
       ${_("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='<a href=\"mailto:{0}\">{0}</a>'.format(settings.TECH_SUPPORT_EMAIL)
+      tech_support_email=u'<a href=\"mailto:{0}\">{0}</a>'.format(settings.TECH_SUPPORT_EMAIL)
       )}
     </p>
   </section>
diff --git a/lms/templates/dashboard/_dashboard_prompt_midcourse_reverify.html b/lms/templates/dashboard/_dashboard_prompt_midcourse_reverify.html
index 8e200db4010..c77f8d9e3f1 100644
--- a/lms/templates/dashboard/_dashboard_prompt_midcourse_reverify.html
+++ b/lms/templates/dashboard/_dashboard_prompt_midcourse_reverify.html
@@ -15,7 +15,10 @@
             <ul class="reverify-list">
               % for item in reverifications["must_reverify"]:
                 <li class="item">
-                  ${_('{course_name}: Re-verify by {date}').format(course_name="<strong>item.course_name</strong>", date=item.date)}
+                  ${_('{course_name}: Re-verify by {date}').format(
+		      course_name=u"<strong>{0}</strong>".format(item.course_name),
+		      date=item.date
+		  )}
                 </li>
               % endfor
             </ul>
@@ -39,7 +42,10 @@
           % for item in reverifications["must_reverify"]:
           <div class="copy">
             <p class='activation-message'>
-              ${_('To continue in the ID Verified track in {course_name}, you need to re-verify your identity by {date}.').format(course_name="<strong>" + item.course_name + "</strong>", 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"<strong>{}</strong>".format(item.course_name),
+	          date=item.date
+	      )}
             </p>
           </div>
         </div>
@@ -65,9 +71,12 @@
         % if item.display:
         <div class="copy">
           <p class='activation-message'>
-            ${_('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="<strong>" + item.course_name+ "</strong>", email='<a class="contact-link" href="mailto:{email}">{email}</a>'.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"<strong>{}</strong>".format(item.course_name),
+	        email=u'<a class="contact-link" href="mailto:{email}">{email}</a>'.format(
+                    email=billing_email
+	        )
+	    )}
           </p>
         </div>
       </div>
diff --git a/lms/templates/enroll_students.html b/lms/templates/enroll_students.html
index 9ffaa8c1bf3..5d3e2f798ad 100644
--- a/lms/templates/enroll_students.html
+++ b/lms/templates/enroll_students.html
@@ -24,8 +24,3 @@ ${ rejected_students }
 
 <p> ${_("Debug: ")}
 <p> ${ debug }
-
-
-<p> "foo"
-<p> "bar"
-<p> "biff"
diff --git a/lms/templates/help_modal.html b/lms/templates/help_modal.html
index cdbe3d2ca8b..195cb9d9032 100644
--- a/lms/templates/help_modal.html
+++ b/lms/templates/help_modal.html
@@ -27,7 +27,11 @@
     </button>
 
     <header>
-      <h2>${_('{platform_name} Help').format(platform_name='<span class="edx">{}</span>'.format(platform_name))}</h2>
+      <h2>
+	${_('{platform_name} Help').format(
+	    platform_name=u'<span class="edx">{}</span>'.format(platform_name)
+	)}
+      </h2>
       <hr>
     </header>
 
diff --git a/lms/templates/module-error.html b/lms/templates/module-error.html
index 4d2b2a8e95a..45ad4e4512a 100644
--- a/lms/templates/module-error.html
+++ b/lms/templates/module-error.html
@@ -3,14 +3,14 @@
 <section class="outside-app">
   <h1>
     ${_("There has been an error on the {platform_name} servers").format(
-        platform_name="<em>{}</em>".format(settings.PLATFORM_NAME)
+        platform_name=u"<em>{}</em>".format(settings.PLATFORM_NAME)
     )}
   </h1>
   <p>
     ${_("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="<a href=\"mailto:{0}\">{0}</a>".format(settings.TECH_SUPPORT_EMAIL)
+        tech_support_email=u"<a href=\"mailto:{0}\">{0}</a>".format(settings.TECH_SUPPORT_EMAIL)
     )}
   </p>
 
diff --git a/lms/templates/signup_modal.html b/lms/templates/signup_modal.html
index 569f6ea722f..efe2622f6fc 100644
--- a/lms/templates/signup_modal.html
+++ b/lms/templates/signup_modal.html
@@ -22,7 +22,7 @@
       <header>
         <h2>
 	  ${_('Sign Up for {platform_name}').format(
-	      platform_name='<span class="edx">{}</span>'.format(settings.PLATFORM_NAME)
+	      platform_name=u'<span class="edx">{}</span>'.format(settings.PLATFORM_NAME)
 	  )}
 	</h2>
         <hr>
@@ -35,26 +35,26 @@
 
         <div class="input-group">
 	  % if has_extauth_info is UNDEFINED:
-          <label data-field="email" for="signup_email">${_('E-mail')} '*'</label>
+          <label data-field="email" for="signup_email">${_('E-mail')} + ' *'</label>
 	    <input id="signup_email" type="email" name="email" placeholder="${_('e.g. yourname@domain.com')}" required />
 
-          <label data-field="password" for="signup_password">${_('Password')} '*'</label>
+          <label data-field="password" for="signup_password">${_('Password')} + ' *'</label>
 	    <input id="signup_password" type="password" name="password" placeholder="&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;" required />
 
-	  <label data-field="username" for="signup_username">${_('Public Username')} '*'</label>
+	  <label data-field="username" for="signup_username">${_('Public Username')} + ' *'</label>
 	    <input id="signup_username" type="text" name="username" placeholder="${_('e.g. yourname (shown on forums)')}" required />
 
-          <label data-field="name" for="signup_fullname">${_('Full Name')} '*'</label>
+          <label data-field="name" for="signup_fullname">${_('Full Name')} + ' *'</label>
 	    <input id="signup_fullname" type="text" name="name" placeholder="${_('e.g. Your Name (for certificates)')}" required />
 	  % else:
 	  <p>${_('<i>Welcome</i> {name}').format(name=extauth_id)}</p><br/>
 	  <p><i>${_('Enter a public username:')}</i></p>
 
-          <label data-field="username" for="signup_username">${_('Public Username')} '*'</label>
+          <label data-field="username" for="signup_username">${_('Public Username')} + ' *'</label>
 	      <input id="signup_username" type="text" name="username" value="${extauth_username}" placeholder="${_('e.g. yourname (shown on forums)')}" required />
 
           % if ask_for_email:
-            <label data-field="email" for="signup_email">${_('E-mail')} '*'</label>
+            <label data-field="email" for="signup_email">${_('E-mail')} + ' *'</label>
             <input id="signup_email" type="email" name="email" placeholder="${_('e.g. yourname@domain.com')}" required />
           % endif
 
@@ -129,7 +129,7 @@
             <input id="signup_tos" name="terms_of_service" type="checkbox" value="true">
             ${_('I agree to the {link_start}Terms of Service{link_end}').format(
               link_start='<a href="{url}" target="_blank">'.format(url=reverse('tos')),
-              link_end='</a>') '*'}
+              link_end='</a>') + ' *'}
           </label>
 
           % if settings.REGISTRATION_EXTRA_FIELDS['honor_code'] != 'hidden':
@@ -137,7 +137,7 @@
             <input id="signup_honor" name="honor_code" type="checkbox" value="true">
             ${_('I agree to the {link_start}Honor Code{link_end}').format(
               link_start='<a href="{url}" target="_blank">'.format(url=reverse('honor')),
-              link_end='</a>') '*'}
+              link_end='</a>') + ' *'}
           </label>
           % endif
         </div>
diff --git a/lms/templates/static_templates/server-down.html b/lms/templates/static_templates/server-down.html
index 528e76ed944..3ff617e00d7 100644
--- a/lms/templates/static_templates/server-down.html
+++ b/lms/templates/static_templates/server-down.html
@@ -4,12 +4,12 @@
 <section class="outside-app">
   <h1>
     ${_("Currently the {platform_name} servers are down").format(
-        platform_name="<em>{}</em>".format(settings.PLATFORM_NAME)
+        platform_name=u"<em>{}</em>".format(settings.PLATFORM_NAME)
     )}
   </h1>
   <p>
     ${_("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="<a href=\"mailto:{0}\">{0}</a>".format(settings.TECH_SUPPORT_EMAIL)
+        tech_support_email=u"<a href=\"mailto:{0}\">{0}</a>".format(settings.TECH_SUPPORT_EMAIL)
     )}</p>
 </section>
diff --git a/lms/templates/static_templates/server-error.html b/lms/templates/static_templates/server-error.html
index ee0fd2db923..cf5d79c7ce2 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" />
 
 <section class="outside-app">
-  <h1>${_(u"There has been a 500 error on the {platform_name} servers").format(
-    platform_name="<em>{}</em>".format(platform_name=settings.PLATFORM_NAME)
-  )}</h1>
-  <p>${_(u'Please wait a few seconds and then reload the page. If the problem persists, please email us at {email}.').format(
+  <h1>
+    ${_(u"There has been a 500 error on the {platform_name} servers").format(
+        platform_name=u"<em>{}</em>".format(platform_name=settings.PLATFORM_NAME)
+    )}
+  </h1>
+  <p>
+    ${_(u'Please wait a few seconds and then reload the page. If the problem persists, please email us at {email}.').format(
         email=u'<a href="mailto:{email}">{email}</a>'.format(
             email=settings.TECH_SUPPORT_EMAIL
         )
-  )}</p>
+    )}
+  </p>
 </section>
diff --git a/lms/templates/static_templates/server-overloaded.html b/lms/templates/static_templates/server-overloaded.html
index 76593ecb0f9..e08317f3b46 100644
--- a/lms/templates/static_templates/server-overloaded.html
+++ b/lms/templates/static_templates/server-overloaded.html
@@ -4,13 +4,13 @@
 <section class="outside-app">
   <h1>
     ${_("Currently the {platform_name} servers are overloaded").format(
-        platform_name="<em>{}</em>".format(platform_name=settings.PLATFORM_NAME)
+        platform_name=u"<em>{}</em>".format(platform_name=settings.PLATFORM_NAME)
     )}
   </h1>
   <p>
     ${_("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="<a href=\"mailto:{0}\">{0}</a>".format(tech_support_email=settings.TECH_SUPPORT_EMAIL)
+        tech_support_email=u"<a href=\"mailto:{0}\">{0}</a>".format(tech_support_email=settings.TECH_SUPPORT_EMAIL)
     )}
   </p>
 </section>
-- 
GitLab