From 2d08b3a3947eafbe804f8ce7ee5b147498736a81 Mon Sep 17 00:00:00 2001 From: Sarina Canelake Date: Thu, 3 Apr 2014 21:14:46 -0400 Subject: [PATCH] Fix i18n'd strings to be easier for translators to understand Signup modal Just translate discussion sr text Markdown editor help Help modal and reverify dash --- .../discussion/views/discussion_content_view.coffee | 9 +++++---- lms/static/js/Markdown.Editor.js | 4 ++-- lms/templates/enroll_students.html | 6 +++--- lms/templates/help_modal.html | 2 +- lms/templates/signup_modal.html | 12 ++++++------ .../verify_student/midcourse_reverify_dash.html | 12 ++++++++---- 6 files changed, 25 insertions(+), 20 deletions(-) diff --git a/common/static/coffee/src/discussion/views/discussion_content_view.coffee b/common/static/coffee/src/discussion/views/discussion_content_view.coffee index 90abbb4cf3..be36da1d43 100644 --- a/common/static/coffee/src/discussion/views/discussion_content_view.coffee +++ b/common/static/coffee/src/discussion/views/discussion_content_view.coffee @@ -170,16 +170,17 @@ if Backbone? buttonTextFmt = if voted ngettext( - "%(voteNum)s%(startSrSpan)s vote (click to remove your vote)%(endSrSpan)s", - "%(voteNum)s%(startSrSpan)s votes (click to remove your vote)%(endSrSpan)s", + "vote (click to remove your vote)", + "votes (click to remove your vote)", voteNum ) else ngettext( - "%(voteNum)s%(startSrSpan)s vote (click to vote)%(endSrSpan)s", - "%(voteNum)s%(startSrSpan)s votes (click to vote)%(endSrSpan)s", + "vote (click to vote)", + "votes (click to vote)", voteNum ) + buttonTextFmt = "%(voteNum)s%(startSrSpan)s " + buttonTextFmt + "%(endSrSpan)s" buttonText = interpolate( buttonTextFmt, {voteNum: voteNum, startSrSpan: "", endSrSpan: ""}, diff --git a/lms/static/js/Markdown.Editor.js b/lms/static/js/Markdown.Editor.js index 7bb498741f..e28c211d7b 100644 --- a/lms/static/js/Markdown.Editor.js +++ b/lms/static/js/Markdown.Editor.js @@ -27,8 +27,8 @@ // The text that appears on the upper part of the dialog box when // entering links. - var linkDialogText = gettext("

Insert Hyperlink

http://example.com/ \"optional title\"

"); - var imageDialogText = gettext("

Insert Image (upload file or type url)

http://example.com/images/diagram.jpg \"optional title\"

"); + 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\"") + "

"; // The default text that appears in the dialog input box when entering // links. diff --git a/lms/templates/enroll_students.html b/lms/templates/enroll_students.html index c3c4f5111b..9ffaa8c1bf 100644 --- a/lms/templates/enroll_students.html +++ b/lms/templates/enroll_students.html @@ -26,6 +26,6 @@ ${ rejected_students }

${ debug } -

${_("foo")} -

${_("bar")} -

${_("biff")} +

"foo" +

"bar" +

"biff" diff --git a/lms/templates/help_modal.html b/lms/templates/help_modal.html index 8586801a4c..cdbe3d2ca8 100644 --- a/lms/templates/help_modal.html +++ b/lms/templates/help_modal.html @@ -27,7 +27,7 @@

-

${_('{span_start}{platform_name}{span_end} Help').format(span_start='', span_end='', platform_name=platform_name)}

+

${_('{platform_name} Help').format(platform_name='{}'.format(platform_name))}


diff --git a/lms/templates/signup_modal.html b/lms/templates/signup_modal.html index e5eb102eba..f846dc7ea2 100644 --- a/lms/templates/signup_modal.html +++ b/lms/templates/signup_modal.html @@ -31,26 +31,26 @@
% if has_extauth_info is UNDEFINED: - + - + - + - + % else:

${_('Welcome {name}').format(name=extauth_id)}


${_('Enter a public username:')}

- + % if ask_for_email: - + % endif diff --git a/lms/templates/verify_student/midcourse_reverify_dash.html b/lms/templates/verify_student/midcourse_reverify_dash.html index 45a068943f..44aceb928e 100644 --- a/lms/templates/verify_student/midcourse_reverify_dash.html +++ b/lms/templates/verify_student/midcourse_reverify_dash.html @@ -25,7 +25,8 @@

${item.course_name} (${item.course_number})

${_('Re-verify by {date}').format(date="" + item.date + "")}

-

Re-verify for ${item.course_number}

+

+ ${_("Re-verify for {course_number}").format(course_number=${item.course_number})}

% endfor @@ -42,7 +43,8 @@

${item.course_name} (${item.course_number})

${_('Re-verify by {date}').format(date="" + item.date + "")}

-

Re-verify for ${item.course_number}

+

+ ${_("Re-verify for {course_number}").format(course_number=${item.course_number})}

% endfor @@ -94,12 +96,14 @@ % endif % if reverifications["must_reverify"]: -

${_("Don't want to re-verify right now? {a_start}Return to where you left off{a_end}").format( +

${_("Don't want to re-verify right now? ") + "{a_start}{text}{a_end}".format( + text=_("Return to where you left off"), a_start=''.format(url=referer), a_end="", )}

% else: -

${_("{a_start}Return to where you left off{a_end}").format( +

${"{a_start}{text}{a_end}".format( + text=_("Return to where you left off"), a_start=''.format(url=referer), a_end="", )}