Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: fix and update translate strings #353

Merged
merged 4 commits into from
Apr 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Please See the `releases tab <https://github.com/openedx/xblock-lti-consumer/rel

Unreleased
~~~~~~~~~~
* Updated PII JS so strings can be extracted for translation.

9.0.1 - 2023-04-11
------------------
Expand Down
15 changes: 7 additions & 8 deletions lti_consumer/static/js/xblock_lti_consumer.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ function LtiConsumerXBlock(runtime, element) {

if (showCancelButton) {
$dialog_container
.append('<button style="margin-right:1rem" id="cancel-button">Cancel</button>');
.append('<button style="margin-right:1rem" id="cancel-button">' + gettext("Cancel") + '</button>');
}
$dialog_container.append('<button id="confirm-button">OK</button>');
$dialog_container.append('<button id="confirm-button">' + gettext('OK') + '</button>');

// When a learner clicks "OK" or "Cancel" in the consent dialog, remove the consent dialog, show the launch
// button, and resolve the promise.
Expand Down Expand Up @@ -154,21 +154,20 @@ function LtiConsumerXBlock(runtime, element) {

function renderPIIConsentPromptIfRequired(onSuccess, showCancelButton=true) {
if (askToSendUsername && askToSendEmail) {
msg = "Click OK to have your username and e-mail address sent to a 3rd party application.";
msg = gettext('Click OK to have your username and e-mail address sent to a 3rd party application.');
} else if (askToSendUsername) {
msg = "Click OK to have your username sent to a 3rd party application.";
msg = gettext('Click OK to have your username sent to a 3rd party application.');
} else if (askToSendEmail) {
msg = "Click OK to have your e-mail address sent to a 3rd party application.";
msg = gettext('Click OK to have your e-mail address sent to a 3rd party application.');
} else {
onSuccess("OK");
onSuccess('OK');
return;
}

if (showCancelButton) {
msg += "\n\nClick Cancel to return to this page without sending your information.";
msg += '\n\n' + gettext('Click Cancel to return to this page without sending your information.');
}

msg = gettext(msg);
$.when(confirmDialog(msg, $(this), showCancelButton)).then(onSuccess);
}

Expand Down
Loading