Removing JS gettext() in favor of server-side substitution.
[LMS-1680]
This commit is contained in:
committed by
Sarina Canelake
parent
eeb5f81272
commit
ff192935d8
@@ -144,7 +144,7 @@ FEATURES = {
|
||||
# Enables the student notes API and UI.
|
||||
'ENABLE_STUDENT_NOTES': True,
|
||||
|
||||
# Provide a UI to allow users to submit feedback from the LMS
|
||||
# Provide a UI to allow users to submit feedback from the LMS (left-hand help modal)
|
||||
'ENABLE_FEEDBACK_SUBMISSION': False,
|
||||
|
||||
# Turn on a page that lets staff enter Python code to be run in the
|
||||
|
||||
@@ -60,14 +60,14 @@ discussion_link = get_discussion_link(course) if course else None
|
||||
<form id="feedback_form" class="feedback_form" method="post" data-remote="true" action="/submit_feedback">
|
||||
<div id="feedback_error" class="modal-form-error" tabindex="-1"></div>
|
||||
% if not user.is_authenticated():
|
||||
<label data-field="name" for="feedback_form_name">${_('Name*')}</label>
|
||||
<label data-field="name" for="feedback_form_name">${_('Name')}*</label>
|
||||
<input name="name" type="text" id="feedback_form_name" aria-required="true">
|
||||
<label data-field="email" for="feedback_form_email">${_('E-mail*')}</label>
|
||||
<label data-field="email" for="feedback_form_email">${_('E-mail')}*</label>
|
||||
<input name="email" type="text" id="feedback_form_email" aria-required="true">
|
||||
% endif
|
||||
<label data-field="subject" for="feedback_form_subject">${_('Briefly describe your issue*')}</label>
|
||||
<label data-field="subject" for="feedback_form_subject">${_('Briefly describe your issue')}*</label>
|
||||
<input name="subject" type="text" id="feedback_form_subject" aria-required="true">
|
||||
<label data-field="details" for="feedback_form_details">${_('Tell us the details*')}
|
||||
<label data-field="details" for="feedback_form_details">${_('Tell us the details')}*
|
||||
<span class="tip">${_('Include error messages, steps which lead to the issue, etc')}</span></label>
|
||||
<textarea name="details" id="feedback_form_details" aria-required="true"></textarea>
|
||||
<input name="issue_type" type="hidden">
|
||||
@@ -75,7 +75,7 @@ discussion_link = get_discussion_link(course) if course else None
|
||||
<input name="course_id" type="hidden" value="${course.id | h}">
|
||||
% endif
|
||||
<div class="submit">
|
||||
<input name="submit" type="submit" value="Submit" id="feedback_submit">
|
||||
<input name="submit" type="submit" value="${_('Submit')}" id="feedback_submit">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@@ -168,29 +168,29 @@ discussion_link = get_discussion_link(course) if course else None
|
||||
$("#feedback_link_problem").click(function(event) {
|
||||
showFeedback(
|
||||
event,
|
||||
gettext("problem"),
|
||||
gettext("Report a Problem"),
|
||||
gettext("Brief description of the problem*"),
|
||||
gettext("Details of the problem you are encountering*") + "<span class='tip'>" +
|
||||
gettext("Include error messages, steps which lead to the issue, etc.") + "</span>"
|
||||
"${_('problem')}",
|
||||
"${_('Report a Problem')}",
|
||||
"${_('Brief description of the problem')}" + "*",
|
||||
"${_('Details of the problem you are encountering')}" + "*" + "<span class='tip'>" +
|
||||
"${_('Include error messages, steps which lead to the issue, etc.')}" + "</span>"
|
||||
);
|
||||
});
|
||||
$("#feedback_link_suggestion").click(function(event) {
|
||||
showFeedback(
|
||||
event,
|
||||
gettext("suggestion"),
|
||||
gettext("Make a Suggestion"),
|
||||
gettext("Brief description of your suggestion*"),
|
||||
gettext("Details*")
|
||||
"${_('suggestion')}",
|
||||
"${_('Make a Suggestion')}",
|
||||
"${_('Brief description of your suggestion')}" + "*",
|
||||
"${_('Details')}" + "*"
|
||||
);
|
||||
});
|
||||
$("#feedback_link_question").click(function(event) {
|
||||
showFeedback(
|
||||
event,
|
||||
gettext("question"),
|
||||
gettext("Ask a Question"),
|
||||
gettext("Brief summary of your question*"),
|
||||
gettext("Details*")
|
||||
"${_('question')}",
|
||||
"${_('Ask a Question')}",
|
||||
"${_('Brief summary of your question')}" + "*",
|
||||
"${_('Details')}" + "*"
|
||||
);
|
||||
});
|
||||
$("#feedback_form").submit(function() {
|
||||
@@ -218,16 +218,16 @@ discussion_link = get_discussion_link(course) if course else None
|
||||
$("#feedback_error").html(responseData.error).stop().css("display", "block");
|
||||
} else {
|
||||
// If no data (or malformed data) is returned, a server error occurred
|
||||
htmlStr = gettext("An error has occurred.");
|
||||
htmlStr = "${_('An error has occurred.')}";
|
||||
% if settings.FEEDBACK_SUBMISSION_EMAIL:
|
||||
htmlStr += " " + _.template(
|
||||
gettext("Please {link_start}send us e-mail{link_end}."),
|
||||
"${_('Please {link_start}send us e-mail{link_end}.')}",
|
||||
{link_start: '<a href="#" id="feedback_email">', link_end: '</a>'},
|
||||
{interpolate: /\{(.+?)\}/g})
|
||||
% else:
|
||||
// If no email is configured, we can't do much other than
|
||||
// ask the user to try again later
|
||||
htmlStr += gettext(" Please try again later.");
|
||||
htmlStr += "${_('Please try again later.')}";
|
||||
% endif
|
||||
$("#feedback_error").html(htmlStr).stop().css("display", "block");
|
||||
% if settings.FEEDBACK_SUBMISSION_EMAIL:
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
$submitButton.
|
||||
addClass('is-disabled').
|
||||
prop('disabled', true).
|
||||
html("${_(u'Processing your account information…')}");
|
||||
text("${_(u'Processing your account information…')}");
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
$(function() {
|
||||
var form = $("#disable-form");
|
||||
$("#submit-form").click(function(){
|
||||
$("#account-change-status").html(gettext("working..."));
|
||||
$("#account-change-status").text("${_('working...')}");
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: form.attr('action'),
|
||||
|
||||
@@ -70,13 +70,13 @@
|
||||
$submitButton.
|
||||
removeClass('is-disabled').
|
||||
removeProp('disabled').
|
||||
html("${_('Update my {platform_name} Account').format(platform_name=settings.PLATFORM_NAME)}");
|
||||
text("${_('Update my {platform_name} Account').format(platform_name=settings.PLATFORM_NAME)}");
|
||||
}
|
||||
else {
|
||||
$submitButton.
|
||||
addClass('is-disabled').
|
||||
prop('disabled', true).
|
||||
html(gettext('Processing your account information …'));
|
||||
text("${_(u'Processing your account information …')}");
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -76,13 +76,13 @@
|
||||
$submitButton.
|
||||
removeClass('is-disabled').
|
||||
removeProp('disabled').
|
||||
html("${_('Create My {platform_name} Account').format(platform_name=settings.PLATFORM_NAME)}");
|
||||
text("${_('Create My {platform_name} Account').format(platform_name=settings.PLATFORM_NAME)}");
|
||||
}
|
||||
else {
|
||||
$submitButton.
|
||||
addClass('is-disabled').
|
||||
prop('disabled', true).
|
||||
html(gettext('Processing your account information …'));
|
||||
text("${_(u'Processing your account information…')}");
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user