diff --git a/cms/djangoapps/contentstore/tests/test_assets.py b/cms/djangoapps/contentstore/tests/test_assets.py index 4bc14ad4a374..36bf4f95786b 100644 --- a/cms/djangoapps/contentstore/tests/test_assets.py +++ b/cms/djangoapps/contentstore/tests/test_assets.py @@ -73,6 +73,14 @@ def assert_correct_asset_response(self, url, expected_start, expected_length, ex self.assertEquals(len(assets), expected_length) self.assertEquals(json_response['totalCount'], expected_total) + # Test valid contentType for pdf asset (textbook.pdf) + self.assertContains(resp, "/c4x/edX/toy/asset/textbook.pdf") + asset_location = StaticContent.get_location_from_path('/c4x/edX/toy/asset/textbook.pdf') + content = contentstore().find(asset_location) + # Check after import textbook.pdf has valid contentType ('application/pdf') + # Note: Actual contentType for textbook.pdf in asset.json is 'text/pdf' + self.assertEqual(content.content_type, 'application/pdf') + class UploadTestCase(CourseTestCase): """ diff --git a/cms/templates/base.html b/cms/templates/base.html index 9be2b92a01fc..6f87c4c5a973 100644 --- a/cms/templates/base.html +++ b/cms/templates/base.html @@ -77,7 +77,7 @@ "utility": "js/src/utility", "accessibility": "js/src/accessibility_tools", "draggabilly": "js/vendor/draggabilly.pkgd", - "URI": "/js/vendor/URI.min", + "URI": "js/vendor/URI.min", // externally hosted files "tender": "//edxedge.tenderapp.com/tender_widget", diff --git a/cms/templates/export.html b/cms/templates/export.html index 6f2853e77de7..b70bf7ae3691 100644 --- a/cms/templates/export.html +++ b/cms/templates/export.html @@ -94,7 +94,6 @@
${_("You can export courses and edit them outside of Studio. The exported file is a .tar.gz file (that is, a .tar file compressed with GNU Zip) that contains the course structure and content. You can also re-import courses that you've exported.").format(em_start='', em_end="")}
${_("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/common/lib/xmodule/xmodule/js/src/annotatable/display.coffee b/common/lib/xmodule/xmodule/js/src/annotatable/display.coffee index 8a32c8f51edf..531ea9114518 100644 --- a/common/lib/xmodule/xmodule/js/src/annotatable/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/annotatable/display.coffee @@ -160,7 +160,10 @@ class @Annotatable @hideTips visible toggleAnnotationButtonText: (hide) -> - buttonText = (if hide then 'Show' else 'Hide')+' Annotations' + if hide + buttonText = gettext('Show Annotations') + else + buttonText = gettext('Hide Annotations') @$(@toggleAnnotationsSelector).text(buttonText) toggleInstructions: () -> @@ -169,7 +172,10 @@ class @Annotatable @toggleInstructionsText hide toggleInstructionsButton: (hide) -> - txt = (if hide then 'Expand' else 'Collapse')+' Instructions' + if hide + txt = gettext('Expand Instructions') + else + txt = gettext('Collapse Instructions') cls = (if hide then ['expanded', 'collapsed'] else ['collapsed','expanded']) @$(@toggleInstructionsSelector).text(txt).removeClass(cls[0]).addClass(cls[1]) @@ -221,13 +227,14 @@ class @Annotatable makeTipTitle: (el) -> (api) => title = $(el).data('comment-title') - (if title then title else 'Commentary') + (if title then title else gettext('Commentary')) createComment: (text) -> $("A.z&&(z===D?(ta=new THREE.RenderableSprite,B.push(ta),D++,z++,w=ta):w=B[z++],w.id=U.id,w.x=A.x*fa,w.y=A.y*fa,w.z=A.z,w.object=U,w.rotation=U.rotation,w.scale.x=U.scale.x*Math.abs(w.x-(A.x+f.projectionMatrix.elements[0])/(A.w+f.projectionMatrix.elements[12])),
- w.scale.y=U.scale.y*Math.abs(w.y-(A.y+f.projectionMatrix.elements[5])/(A.w+f.projectionMatrix.elements[13])),w.material=U.material,x.elements.push(w)));!0===m&&x.elements.sort(b);return x}};THREE.Face3=function(a,b,c,d,e,f){this.a=a;this.b=b;this.c=c;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.color=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=e instanceof Array?e:[];this.vertexTangents=[];this.materialIndex=void 0!==f?f:0;this.centroid=new THREE.Vector3};
- THREE.Face3.prototype={constructor:THREE.Face3,clone:function(){var a=new THREE.Face3(this.a,this.b,this.c);a.normal.copy(this.normal);a.color.copy(this.color);a.centroid.copy(this.centroid);a.materialIndex=this.materialIndex;var b,c;b=0;for(c=this.vertexNormals.length;b
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}.
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 @@ def get_processor_exception_html(exception):
'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 @@ def get_processor_exception_html(exception):
# 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 @@ def get_processor_exception_html(exception):
# 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 @@ def get_processor_exception_html(exception):
# 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 @@ def get_processor_exception_html(exception):
# 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 c95a95db1b14..750e8ee463d0 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 3cb82dea1352..e46ab1dc29be 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/courseware/courseware-error.html b/lms/templates/courseware/courseware-error.html
index 9018495bff7e..71744259a663 100644
--- a/lms/templates/courseware/courseware-error.html
+++ b/lms/templates/courseware/courseware-error.html
@@ -2,7 +2,6 @@
<%inherit file="/main.html" />
<%namespace name='static' file='../static_content.html'/>
<%block name="bodyclass">courseware%block>
-## Translators: "edX" should *not* be translated
<%block name="title"> ${_("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)} ${_("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="")} ${_("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="")}
- {% comment %}
- Translators: Do not translate 'cheatsheetLink'
- {% endcomment %}
- {% blocktrans with start_link="" end_link="" %}
- Markdown syntax is allowed. See the {{ start_link }}cheatsheet{{ end_link }} for help.
- {% endblocktrans %}
+ {% blocktrans with start_link="" end_link="" %}
+ Markdown syntax is allowed. See the {{ start_link }}cheatsheet{{ end_link }} for help.
+ {% endblocktrans %}
${_("Currently the {platform_name} servers are overloaded").format(platform_name=settings.PLATFORM_NAME)}
- ${_("Why Do I Need to Re-Verify?")}
${_("Having Technical Trouble?")}
${_("Change your mind?")}
${_("Technical Requirements")}
${_("Credit or Debit Card")}
%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
diff --git a/lms/templates/wiki/includes/cheatsheet.html b/lms/templates/wiki/includes/cheatsheet.html
index 6c3f359ef760..4ac9bbd85adb 100644
--- a/lms/templates/wiki/includes/cheatsheet.html
+++ b/lms/templates/wiki/includes/cheatsheet.html
@@ -21,9 +21,7 @@
{% trans "Wiki Syntax Help" %}
{% trans "[Article Name](wiki:ArticleName)" %}
{% trans "edX Additions:" %}
circuit-schematic:
$LaTeX Math Expression$
@@ -34,12 +32,9 @@ {% trans "edX Additions:" %}
{% trans "Useful examples:" %}
-{% comment %}
- Translators: Do not translate "edX" or "Wikipedia"
-{% endcomment %}
-{% trans "http://wikipedia.org" %}
-{% trans "[Wikipedia](http://wikipedia.org)" %}
-{% trans "[edX Wiki](wiki:/edx/)" %}
+http://wikipedia.org
+[Wikipedia](http://wikipedia.org)
+[edX Wiki](wiki:/edx/)
{% trans "Huge Header" %}
@@ -48,8 +43,10 @@
{% trans "Useful examples:" %}
{% trans "Smaller Header" %}
--------------
+{# Translators: Leave the punctuation, but translate "emphasis" #}
{% trans "*emphasis* or _emphasis_" %}
+{# Translators: Leave the punctuation, but translate "strong" #}
{% trans "**strong** or __strong__" %}
- {% trans "Unordered List" %}
diff --git a/lms/templates/wiki/includes/editor_widget.html b/lms/templates/wiki/includes/editor_widget.html
index e306787488bc..54cef5e36ebe 100644
--- a/lms/templates/wiki/includes/editor_widget.html
+++ b/lms/templates/wiki/includes/editor_widget.html
@@ -1,10 +1,7 @@
{% load i18n %}