Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

Commit

Permalink
i18n of delete confirmation message
Browse files Browse the repository at this point in the history
  • Loading branch information
Changaco committed Mar 17, 2015
1 parent ef68732 commit 0ef26ec
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 24 deletions.
20 changes: 8 additions & 12 deletions js/gratipay/payments.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Gratipay.payments = {};

Gratipay.payments.init = function(participantId) {
Gratipay.participantId = participantId;
$('#delete form').submit(Gratipay.payments.submitDeleteForm);
$('#delete').submit(Gratipay.payments.submitDeleteForm);

// Lazily depend on Balanced.
var balanced_js = "https://js.balancedpayments.com/1.1/balanced.min.js";
Expand All @@ -25,22 +25,18 @@ Gratipay.payments.init = function(participantId) {
}

Gratipay.payments.submitDeleteForm = function(e) {
var item = $("#payout").length ? "bank account" : "credit card";
var slug = $("#payout").length ? "bank-account" : "credit-card";
var msg = "Really disconnect your " + item + "?";
if (!confirm(msg)) {
e.stopPropagation();
e.preventDefault();
e.stopPropagation();
e.preventDefault();

var $form = $(this);
if (!confirm($form.data('confirm'))) {
return false;
}

jQuery.ajax(
{ url: '/' + slug + '.json'
{ url: $form.attr('action')
, data: {action: "delete"}
, type: "POST"
, success: function() {
window.location.href = '/' + slug + '.html';
}
, success: function() { window.location.reload(); }
, error: Gratipay.error
}
);
Expand Down
10 changes: 4 additions & 6 deletions www/bank-account.html.spt
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,10 @@ title = _("Bank Account")
{% endif %}

{% if bank_account and bank_account.is_setup %}
<div id="delete">
<form action="bank-account.json" class="special" method="POST">
<input type="hidden" name="action" value="delete">
<button>{{ _("Disconnect My Bank Account") }}</button>
</form>
</div>
<form id="delete" action="bank-account.json" method="POST"
data-confirm="{{ _('Are you sure you want to disconnect your bank account ?') }}">

This comment has been minimized.

Copy link
@chadwhitacre

chadwhitacre Mar 17, 2015

Contributor

Is the extra space before the question mark a European thing? (I've noticed you adding a space before a colon as well.) In US English there's no space before the question mark here.

This comment has been minimized.

Copy link
@Changaco

Changaco Mar 17, 2015

Author Contributor

It's a French thing I guess. I'll be more careful.

This comment has been minimized.

Copy link
@chadwhitacre

chadwhitacre Mar 18, 2015

Contributor

It's a French thing I guess.

Indeed. Found this on a coffee package this morning:

space-question

:-)

This comment has been minimized.

Copy link
@chadwhitacre

chadwhitacre Mar 18, 2015

Contributor

(P.S. I checked the English version on the opposite side of the package: no space.)

<button>{{ _("Disconnect My Bank Account") }}</button>
</form>
{% endif %}

<p class="info">Bank account information is stored and processed by <a
Expand Down
10 changes: 4 additions & 6 deletions www/credit-card.html.spt
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,10 @@ title = _("Credit Card")

</form>

<div id="delete">
<form action="credit-card.json" class="special" method="POST">
<input type="hidden" name="action" value="delete">
<button>{{ _("Disconnect My Credit Card") }}</button>
</form>
</div>
<form id="delete" action="credit-card.json" method="POST"
data-confirm="{{ _('Are you sure you want to disconnect your credit card ?') }}">

This comment has been minimized.

Copy link
@chadwhitacre

chadwhitacre Mar 17, 2015

Contributor

Ditto re: space before question mark.

<button>{{ _("Disconnect My Credit Card") }}</button>
</form>

<p class="info">Credit card information is stored and processed by <a
href="https://www.balancedpayments.com/">Balanced Payments</a>.
Expand Down

0 comments on commit 0ef26ec

Please sign in to comment.