From 2157b4d8b74f8af33f59dab9a9946313c6835482 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Thu, 2 Jan 2014 08:42:10 -0500 Subject: [PATCH] Miscellaneous fixes to strings found during i18n work. --- cms/templates/registration/reg_complete.html | 2 +- .../shoppingcart/processors/CyberSource.py | 38 +++++++++---------- lms/static/admin/js/calendar.js | 6 ++- lms/static/admin/js/dateparse.js | 6 ++- .../static_templates/server-overloaded.html | 2 +- .../_reverification_support.html | 2 +- .../verify_student/_verification_support.html | 2 +- .../verify_student/show_requirements.html | 2 +- 8 files changed, 32 insertions(+), 28 deletions(-) diff --git a/cms/templates/registration/reg_complete.html b/cms/templates/registration/reg_complete.html index c6af5d94a5..1e760f9fb8 100644 --- a/cms/templates/registration/reg_complete.html +++ b/cms/templates/registration/reg_complete.html @@ -1,3 +1,3 @@ <%! from django.utils.translation import ugettext as _ %>

Check your email

-

${_("An activation link has been sent to {emaiL}, along with instructions for activating your account.").format(email=email)}

+

${_("An activation link has been sent to {email}, along with instructions for activating your account.").format(email=email)}

diff --git a/lms/djangoapps/shoppingcart/processors/CyberSource.py b/lms/djangoapps/shoppingcart/processors/CyberSource.py index d6811303a1..5c980073d7 100644 --- a/lms/djangoapps/shoppingcart/processors/CyberSource.py +++ b/lms/djangoapps/shoppingcart/processors/CyberSource.py @@ -217,14 +217,14 @@ def get_processor_decline_html(params): """Have to parse through the error codes to return a helpful message""" payment_support_email = settings.PAYMENT_SUPPORT_EMAIL - msg = _(dedent( + msg = dedent(_( """

Sorry! Our payment processor did not accept your payment. - The decision in they returned was {decision}, + The decision they returned was {decision}, and the reason was {reason_code}:{reason_msg}. You were not charged. Please try a different form of payment. - Contact us with payment-specific questions at {email}. + Contact us with payment-related questions at {email}.

""")) @@ -240,7 +240,7 @@ def get_processor_exception_html(exception): payment_support_email = settings.PAYMENT_SUPPORT_EMAIL if isinstance(exception, CCProcessorDataException): - msg = _(dedent( + msg = dedent(_( """

Sorry! Our payment processor sent us back a payment confirmation that had inconsistent data! @@ -251,7 +251,7 @@ def get_processor_exception_html(exception): """.format(msg=exception.message, email=payment_support_email))) return msg elif isinstance(exception, CCProcessorWrongAmountException): - msg = _(dedent( + msg = dedent(_( """

Sorry! Due to an error your purchase was charged for a different amount than the order total! @@ -261,7 +261,7 @@ def get_processor_exception_html(exception): """.format(msg=exception.message, email=payment_support_email))) return msg elif isinstance(exception, CCProcessorSignatureException): - msg = _(dedent( + msg = dedent(_( """

Sorry! Our payment processor sent us back a corrupted message regarding your charge, so we are @@ -307,32 +307,32 @@ REASONCODE_MAP.update( '100': _('Successful transaction.'), '101': _('The request is missing one or more required fields.'), '102': _('One or more fields in the request contains invalid data.'), - '104': _(dedent( + '104': dedent(_( """ The merchantReferenceCode sent with this authorization request matches the merchantReferenceCode of another authorization request that you sent in the last 15 minutes. Possible fix: retry the payment after 15 minutes. """)), '150': _('Error: General system failure. Possible fix: retry the payment after a few minutes.'), - '151': _(dedent( + '151': dedent(_( """ Error: The request was received but there was a server timeout. This error does not include timeouts between the client and the server. Possible fix: retry the payment after some time. """)), - '152': _(dedent( + '152': dedent(_( """ Error: The request was received, but a service did not finish running in time Possible fix: retry the payment after some time. """)), '201': _('The issuing bank has questions about the request. Possible fix: retry with another form of payment'), - '202': _(dedent( + '202': dedent(_( """ Expired card. You might also receive this if the expiration date you provided does not match the date the issuing bank has on file. Possible fix: retry with another form of payment """)), - '203': _(dedent( + '203': dedent(_( """ General decline of the card. No other information provided by the issuing bank. Possible fix: retry with another form of payment @@ -341,7 +341,7 @@ REASONCODE_MAP.update( # 205 was Stolen or lost card. Might as well not show this message to the person using such a card. '205': _('Unknown reason'), '207': _('Issuing bank unavailable. Possible fix: retry again after a few minutes'), - '208': _(dedent( + '208': dedent(_( """ Inactive card or card not authorized for card-not-present transactions. Possible fix: retry with another form of payment @@ -352,13 +352,13 @@ REASONCODE_MAP.update( # Might as well not show this message to the person using such a card. '221': _('Unknown reason'), '231': _('Invalid account number. Possible fix: retry with another form of payment'), - '232': _(dedent( + '232': dedent(_( """ The card type is not accepted by the payment processor. Possible fix: retry with another form of payment """)), '233': _('General decline by the processor. Possible fix: retry with another form of payment'), - '234': _(dedent( + '234': dedent(_( """ There is a problem with our CyberSource merchant configuration. Please let us know at {0} """.format(settings.PAYMENT_SUPPORT_EMAIL))), @@ -370,7 +370,7 @@ REASONCODE_MAP.update( # reason code 239 only applies if we are processing a capture or credit through the API, # so we should never see it '239': _('The requested transaction amount must match the previous transaction amount.'), - '240': _(dedent( + '240': dedent(_( """ The card type sent is invalid or does not correlate with the credit card number. Possible fix: retry with the same card or another form of payment @@ -382,26 +382,26 @@ REASONCODE_MAP.update( # if the previously successful authorization has already been used by another capture request. # This reason code only applies when we are processing a capture through the API # so we should never see it - '242': _(dedent( + '242': dedent(_( """ You requested a capture through the API, but there is no corresponding, unused authorization record. """)), # we should never see 243 '243': _('The transaction has already been settled or reversed.'), # reason code 246 applies only if we are processing a void through the API. so we should never see it - '246': _(dedent( + '246': dedent(_( """ The capture or credit is not voidable because the capture or credit information has already been submitted to your processor. Or, you requested a void for a type of transaction that cannot be voided. """)), # reason code 247 applies only if we are processing a void through the API. so we should never see it '247': _('You requested a credit for a capture that was previously voided'), - '250': _(dedent( + '250': dedent(_( """ Error: The request was received, but there was a timeout at the payment processor. Possible fix: retry the payment. """)), - '520': _(dedent( + '520': dedent(_( """ The authorization request was approved by the issuing bank but declined by CyberSource.' Possible fix: retry with a different form of payment. diff --git a/lms/static/admin/js/calendar.js b/lms/static/admin/js/calendar.js index c95a95db1b..750e8ee463 100644 --- a/lms/static/admin/js/calendar.js +++ b/lms/static/admin/js/calendar.js @@ -23,8 +23,10 @@ function quickElement() { // CalendarNamespace -- Provides a collection of HTML calendar-related helper functions var CalendarNamespace = { - monthsOfYear: gettext('January February March April May June July August September October November December').split(' '), - daysOfWeek: gettext('S M T W T F S').split(' '), + // Translators: the names of months, keep the pipe (|) separators. + monthsOfYear: gettext('January|February|March|April|May|June|July|August|September|October|November|December').split('|'), + // Translators: abbreviations for days of the week, keep the pipe (|) separators. + daysOfWeek: gettext('S|M|T|W|T|F|S').split('|'), firstDayOfWeek: parseInt(get_format('FIRST_DAY_OF_WEEK')), isLeapYear: function(year) { return (((year % 4)==0) && ((year % 100)!=0) || ((year % 400)==0)); diff --git a/lms/static/admin/js/dateparse.js b/lms/static/admin/js/dateparse.js index 3cb82dea13..e46ab1dc29 100644 --- a/lms/static/admin/js/dateparse.js +++ b/lms/static/admin/js/dateparse.js @@ -29,8 +29,10 @@ if (typeof Array.prototype.filter == 'undefined') { }; } -var monthNames = gettext("January February March April May June July August September October November December").split(" "); -var weekdayNames = gettext("Sunday Monday Tuesday Wednesday Thursday Friday Saturday").split(" "); +// Translators: the names of months, keep the pipe (|) separators. +var monthNames = gettext("January|February|March|April|May|June|July|August|September|October|November|December").split("|"); +// Translators: the names of days, keep the pipe (|) separators. +var weekdayNames = gettext("Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday").split("|"); /* Takes a string, returns the index of the month matching that string, throws an error if 0 or more than 1 matches diff --git a/lms/templates/static_templates/server-overloaded.html b/lms/templates/static_templates/server-overloaded.html index 7079ad4d2e..05a25f228c 100644 --- a/lms/templates/static_templates/server-overloaded.html +++ b/lms/templates/static_templates/server-overloaded.html @@ -3,5 +3,5 @@

${_("Currently the {platform_name} servers are overloaded").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=settings.TECH_SUPPORT_EMAIL)}

+

${_("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=settings.TECH_SUPPORT_EMAIL)}

diff --git a/lms/templates/verify_student/_reverification_support.html b/lms/templates/verify_student/_reverification_support.html index 14b249762e..44bf0c89d8 100644 --- a/lms/templates/verify_student/_reverification_support.html +++ b/lms/templates/verify_student/_reverification_support.html @@ -18,7 +18,7 @@
  • ${_("Having Technical Trouble?")}

    -

    ${_("Please make sure your browser is updated to the {strong_start}{a_start}most recent version possible{a_end}{strong_end}. Also, please make sure your {strong_start}web cam is plugged in, turned on, and allowed to function in your web browser (commonly adjustable in your browser settings).{strong_end}").format(a_start='', a_end="", strong_start="", strong_end="")}

    +

    ${_("Please make sure your browser is updated to the {a_start}most recent version possible{a_end}. Also, please make sure your web cam is plugged in, turned on, and allowed to function in your web browser (commonly adjustable in your browser settings)").format(a_start='', a_end="")}

  • diff --git a/lms/templates/verify_student/_verification_support.html b/lms/templates/verify_student/_verification_support.html index 260ba7bae3..a4d2196958 100644 --- a/lms/templates/verify_student/_verification_support.html +++ b/lms/templates/verify_student/_verification_support.html @@ -27,7 +27,7 @@
  • ${_("Technical Requirements")}

    -

    ${_("Please make sure your browser is updated to the {strong_start}{a_start}most recent version possible{a_end}{strong_end}. Also, please make sure your {strong_start}web cam is plugged in, turned on, and allowed to function in your web browser (commonly adjustable in your browser settings).{strong_end}").format(a_start='', a_end="", strong_start="", strong_end="")}

    +

    ${_("Please make sure your browser is updated to the {a_start}most recent version possible{a_end}. Also, please make sure your web cam is plugged in, turned on, and allowed to function in your web browser (commonly adjustable in your browser settings).").format(a_start='', a_end="")}

  • diff --git a/lms/templates/verify_student/show_requirements.html b/lms/templates/verify_student/show_requirements.html index 3280fec89a..ed9fa4747b 100644 --- a/lms/templates/verify_student/show_requirements.html +++ b/lms/templates/verify_student/show_requirements.html @@ -169,7 +169,7 @@ %if upgrade: ${_("Missing something? You can always continue to audit this course instead.")} %else: - ${_("Missing something? You can always {a_start} audit this course instead {a_end}").format(a_start='', a_end="")} + ${_("Missing something? You can always {a_start}audit this course instead{a_end}").format(a_start='', a_end="")} %endif