From 4e298a1abb141fc74f76feb6628b5f640d3e7456 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Fri, 10 Jan 2014 14:35:17 -0500 Subject: [PATCH 1/2] Add an apostrophe to the Lorem text. --- i18n/dummy.py | 8 +++++--- i18n/tests/test_dummy.py | 18 +++++++++--------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/i18n/dummy.py b/i18n/dummy.py index b192069329bd..2e6c073db06e 100644 --- a/i18n/dummy.py +++ b/i18n/dummy.py @@ -53,10 +53,12 @@ # The print industry's standard dummy text, in use since the 1500s # see http://www.lipsum.com/, then fed through a "fancy-text" converter. -# The string should start with a space. +# The string should start with a space, so that it joins nicely with the text +# that precedes it. The Lorem contains an apostrophe since French often does, +# and translated strings get put into single-quoted strings, which then break. LOREM = " " + " ".join( # join and split just make the string easier here. u""" - Ⱡσяєм ιρѕυм ∂σłσя ѕιт αмєт, ¢σηѕє¢тєтυя α∂ιριѕι¢ιηg єłιт, ѕє∂ ∂σ єιυѕмσ∂ + Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмєт, ¢σηѕє¢тєтυя α∂ιριѕι¢ιηg єłιт, ѕє∂ ∂σ єιυѕмσ∂ тємρσя ιη¢ι∂ι∂υηт υт łαвσяє єт ∂σłσяє мαgηα αłιqυα. υт єηιм α∂ мιηιм νєηιαм, qυιѕ ησѕтяυ∂ єχєя¢ιтαтιση υłłαм¢σ łαвσяιѕ ηιѕι υт αłιqυιρ єχ єα ¢σммσ∂σ ¢σηѕєqυαт. ∂υιѕ αυтє ιяυяє ∂σłσя ιη яєρяєнєη∂єяιт ιη νσłυρтαтє @@ -68,7 +70,7 @@ # To simulate more verbose languages (like German), pad the length of a string # by a multiple of PAD_FACTOR -PAD_FACTOR = 1.3 +PAD_FACTOR = 1.33 class Dummy(Converter): diff --git a/i18n/tests/test_dummy.py b/i18n/tests/test_dummy.py index 2d1b1b71c312..cd51c59743d0 100644 --- a/i18n/tests/test_dummy.py +++ b/i18n/tests/test_dummy.py @@ -34,13 +34,13 @@ def assertUnicodeEquals(self, str1, str2): @ddt.data( (u"hello my name is Bond, James Bond", - u"héllø mý nämé ïs Bønd, Jämés Bønd Ⱡσяєм ι#"), + u"héllø mý nämé ïs Bønd, Jämés Bønd Ⱡ'σяєм ι#"), (u"don't convert tag ids", - u"døn't çønvért täg ïds Ⱡσяєм ιρѕυ#"), + u"døn't çønvért täg ïds Ⱡ'σяєм ιρѕυ#"), (u"don't convert %(name)s tags on %(date)s", - u"døn't çønvért %(name)s tägs øn %(date)s Ⱡσяєм ιρѕ#"), + u"døn't çønvért %(name)s tägs øn %(date)s Ⱡ'σяєм ιρѕ#"), ) def test_dummy(self, data): """ @@ -53,17 +53,17 @@ def test_dummy(self, data): def test_singular(self): entry = POEntry() - entry.msgid = 'A lovely day for a cup of tea.' - expected = u'À løvélý däý før ä çüp øf téä. Ⱡσяєм ι#' + entry.msgid = "A lovely day for a cup of tea." + expected = u"À løvélý däý før ä çüp øf téä. Ⱡ'σяєм #" self.converter.convert_msg(entry) self.assertUnicodeEquals(entry.msgstr, expected) def test_plural(self): entry = POEntry() - entry.msgid = 'A lovely day for a cup of tea.' - entry.msgid_plural = 'A lovely day for some cups of tea.' - expected_s = u'À løvélý däý før ä çüp øf téä. Ⱡσяєм ι#' - expected_p = u'À løvélý däý før sømé çüps øf téä. Ⱡσяєм ιρ#' + entry.msgid = "A lovely day for a cup of tea." + entry.msgid_plural = "A lovely day for some cups of tea." + expected_s = u"À løvélý däý før ä çüp øf téä. Ⱡ'σяєм #" + expected_p = u"À løvélý däý før sømé çüps øf téä. Ⱡ'σяєм ιρ#" self.converter.convert_msg(entry) result = entry.msgstr_plural self.assertUnicodeEquals(result['0'], expected_s) From fd13908b9020b6ec606f1527c5b106fdc10f2319 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Fri, 10 Jan 2014 14:40:34 -0500 Subject: [PATCH 2/2] Fix single-quoted translated strings to be double-quoted. --- cms/templates/component.html | 2 +- cms/templates/import.html | 16 ++++++++-------- cms/templates/widgets/problem-edit.html | 16 ++++++++-------- cms/templates/widgets/sock.html | 4 ++-- .../courseware/instructor_dashboard.html | 2 +- lms/templates/courseware/mktg_course_about.html | 2 +- lms/templates/help_modal.html | 2 +- 7 files changed, 22 insertions(+), 22 deletions(-) diff --git a/cms/templates/component.html b/cms/templates/component.html index 07ab92c59235..cd8da36d00da 100644 --- a/cms/templates/component.html +++ b/cms/templates/component.html @@ -31,6 +31,6 @@ ${_("Edit")} ${_("Delete")} - + ${preview} diff --git a/cms/templates/import.html b/cms/templates/import.html index 51ee1ef83929..0c8f947dcec6 100644 --- a/cms/templates/import.html +++ b/cms/templates/import.html @@ -163,10 +163,10 @@

${_("Warning: Importing while a course is running")}

var feedbackUrl = "${import_status_url}"; var defaults = [ - '${_("There was an error during the upload process.")}\n', - '${_("There was an error while unpacking the file.")}\n', - '${_("There was an error while verifying the file you submitted.")}\n', - '${_("There was an error while importing the new course to our database.")}\n' + "${_("There was an error during the upload process.")}\n", + "${_("There was an error while unpacking the file.")}\n", + "${_("There was an error while verifying the file you submitted.")}\n", + "${_("There was an error while importing the new course to our database.")}\n" ]; $('#fileupload').fileupload({ @@ -201,12 +201,12 @@

${_("Warning: Importing while a course is running")}

CourseImport.stageError(stage, defaults[stage] + errMsg); } else { - alert('${_("Your import has failed.")}\n\n' + errMsg); + alert("${_("Your import has failed.")}\n\n" + errMsg); } - chooseBtn.html('${_("Choose new file")}').show(); + chooseBtn.html("${_("Choose new file")}").show(); bar.hide(); } - chooseBtn.html('${_("Choose new file")}').show(); + chooseBtn.html("${_("Choose new file")}").show(); bar.hide(); }); }); @@ -243,7 +243,7 @@

${_("Warning: Importing while a course is running")}

}, start: function(e) { window.onbeforeunload = function() { - return '${_("Your import is in progress; navigating away will abort it.")}'; + return "${_("Your import is in progress; navigating away will abort it.")}"; } }, sequentialUploads: true, diff --git a/cms/templates/widgets/problem-edit.html b/cms/templates/widgets/problem-edit.html index 2d23a6f44185..e5942828dea6 100644 --- a/cms/templates/widgets/problem-edit.html +++ b/cms/templates/widgets/problem-edit.html @@ -7,24 +7,24 @@ %if enable_markdown:
    -
  • -
  • -
  • -
  • -
  • -
  • -
diff --git a/cms/templates/widgets/sock.html b/cms/templates/widgets/sock.html index 963e55ae434c..4ab954c363eb 100644 --- a/cms/templates/widgets/sock.html +++ b/cms/templates/widgets/sock.html @@ -22,7 +22,7 @@

${_("Studio Support")}