/patron client-side translations

pull/6012/head
Thibault Duplessis 2020-02-09 10:35:20 -06:00
parent 3ede9374d4
commit 8f43ee4c41
4 changed files with 10 additions and 4 deletions

View File

@ -190,7 +190,11 @@ object index {
},
div(cls := "other")(
input(tpe := "radio", name := "plan", id := "plan_other", value := "other"),
label(`for` := "plan_other")(otherAmount())
label(
`for` := "plan_other",
title := pleaseEnterAmount.txt(),
attr("data-trans-other") := otherAmount.txt()
)(otherAmount())
)
)
),

View File

@ -1341,6 +1341,7 @@ val `recurringBilling` = new Translated("recurringBilling", Patron)
val `onetime` = new Translated("onetime", Patron)
val `singleDonation` = new Translated("singleDonation", Patron)
val `otherAmount` = new Translated("otherAmount", Patron)
val `pleaseEnterAmount` = new Translated("pleaseEnterAmount", Patron)
val `withCreditCard` = new Translated("withCreditCard", Patron)
val `withPaypal` = new Translated("withPaypal", Patron)
val `weAreSmallTeam` = new Translated("weAreSmallTeam", Patron)

View File

@ -30,7 +30,7 @@ lichess.checkout = function (publicKey) {
$checkout.find('group.amount .other label').on('click', function () {
var amount;
var raw = prompt("Please enter an amount in USD");
var raw = prompt($(this).attr('title'));
try {
amount = parseFloat(raw.replace(',', '.').replace(/[^0-9\.]/gim, ''));
} catch (e) {
@ -38,7 +38,7 @@ lichess.checkout = function (publicKey) {
}
var cents = Math.round(amount * 100);
if (!cents) {
$(this).text('Other');
$(this).text($(this).data('trans-other'));
$checkout.find('#plan_monthly_1000').click();
return false;
}

View File

@ -23,6 +23,7 @@
<string name="onetime">One-time</string>
<string name="singleDonation">A single donation that grants you the Patron Wings for one month.</string>
<string name="otherAmount">Other</string>
<string name="pleaseEnterAmount">Please enter an amount in USD</string>
<string name="withCreditCard">Credit Card</string>
<string name="withPaypal">PayPal</string>
<string name="weAreSmallTeam">We are a small team, so your support makes a huge difference!</string>
@ -68,7 +69,7 @@ However, Patrons get bragging rights with a cool new profile icon.</string>
<string name="date">Date</string>
<string name="amount">Amount</string>
<string name="transactionCompleted">Your transaction has been completed, and a receipt for your donation has been emailed to you.</string>
<string name="permanentPatron">You now have a permanent Patron account.,</string>
<string name="permanentPatron">You now have a permanent Patron account.</string>
<string name="checkOutProfile">Check out your profile page!</string>
<string name="nowLifetime">You are now a lifetime Lichess Patron!</string>
<string name="nowOneMonth">You are now a Lichess Patron for one month!</string>