From b74e8cf756e185166d2952ae9d6a13b64db192c3 Mon Sep 17 00:00:00 2001 From: lepipele Date: Thu, 22 Mar 2018 12:57:51 -0500 Subject: [PATCH] Translating Invoice expired state --- .../Views/Invoice/Checkout-Body.cshtml | 41 +++++++++---------- BTCPayServer/wwwroot/js/checkout/core.js | 2 + BTCPayServer/wwwroot/js/checkout/langs/en.js | 15 ++++--- 3 files changed, 32 insertions(+), 26 deletions(-) diff --git a/BTCPayServer/Views/Invoice/Checkout-Body.cshtml b/BTCPayServer/Views/Invoice/Checkout-Body.cshtml index fa3d2a1bd..166dca31b 100644 --- a/BTCPayServer/Views/Invoice/Checkout-Body.cshtml +++ b/BTCPayServer/Views/Invoice/Checkout-Body.cshtml @@ -12,9 +12,7 @@ @Html.Partial("Checkout-Spinner")
- - {{$t("Awaiting Payment...")}} - + {{$t("Awaiting Payment...")}}
@Model.TimeLeft
@@ -234,10 +232,10 @@ -
This invoice has been paid.
- @@ -252,10 +250,10 @@
- This invoice has been archived. + {{$t("This invoice has been archived")}}
- Please contact the store for order information or assistance. + {{$t("Archived_Body")}}
@@ -263,26 +261,27 @@
-
What happened?
-
This invoice has expired. An invoice is only valid for @Model.MaxTimeMinutes minutes. You can if you would like to submit your payment again.
-
If you tried to send a payment, it has not yet been accepted by the Bitcoin network. We have not yet received your funds.
+
{{$t("What happened?")}}
- If the transaction - is not accepted by the Bitcoin network, the funds will be spendable - again in your wallet. Depending on your wallet, this may take 48-72 - hours. + {{$t("InvoiceExpired_Body_1", {storeName: srvModel.storeName, maxTimeMinutes: @Model.MaxTimeMinutes})}}
- Invoice ID: {{srvModel.invoiceId}}
- - - Order ID: {{srvModel.orderId}} - + {{$t("InvoiceExpired_Body_2")}} +
+
+ {{$t("InvoiceExpired_Body_3")}} +
+
+ {{$t("Invoice ID")}}: + {{srvModel.invoiceId}} +
+ {{$t("Order ID")}}: + {{srvModel.orderId}}
- Return to {{srvModel.storeName}} + {{$t("Return to StoreName", srvModel)}}
diff --git a/BTCPayServer/wwwroot/js/checkout/core.js b/BTCPayServer/wwwroot/js/checkout/core.js index e8efd8f28..902b17c00 100644 --- a/BTCPayServer/wwwroot/js/checkout/core.js +++ b/BTCPayServer/wwwroot/js/checkout/core.js @@ -45,6 +45,7 @@ function onDataCallback(jsonData) { if (newStatus === "expired" || newStatus === "invalid") { //TODO: different state if the invoice is invalid (failed to confirm after timeout) $(".timer-row").removeClass("expiring-soon"); + // TODO: Needs translate $(".timer-row__message span").html("Invoice expired."); $(".timer-row__spinner").html(""); $("#emailAddressView").removeClass("active"); @@ -292,6 +293,7 @@ $(document).ready(function () { if (perc === 75 && (status === "paidPartial" || status === "new")) { $(".timer-row").addClass("expiring-soon"); + // TODO: Needs translate $(".timer-row__message span").html("Invoice expiring soon ..."); updateProgress(perc); } diff --git a/BTCPayServer/wwwroot/js/checkout/langs/en.js b/BTCPayServer/wwwroot/js/checkout/langs/en.js index 98655c593..2b5e8bb45 100644 --- a/BTCPayServer/wwwroot/js/checkout/langs/en.js +++ b/BTCPayServer/wwwroot/js/checkout/langs/en.js @@ -30,11 +30,16 @@ const locales_en = { // Invoice expired "Invoice expired": "Invoice expired", "What happened?": "What happened?", - "InvoiceExpired_Body": "This invoice has expired. An invoice is only valid for 15 minutes. You can return to TestStore \ -if you would like to submit your payment again. \ -If you tried to send a payment, it has not yet been accepted by the Bitcoin network. We have not yet received your funds. \ -If the transaction is not accepted by the Bitcoin network, the funds will be spendable again in your wallet. Depending on your wallet, this may take 48-72 hours.", + "InvoiceExpired_Body_1": "This invoice has expired. An invoice is only valid for {{maxTimeMinutes}} minutes. \ +You can return to {{storeName}} if you would like to submit your payment again.", + "InvoiceExpired_Body_2": "If you tried to send a payment, it has not yet been accepted by the Bitcoin network. We have not yet received your funds.", + "InvoiceExpired_Body_3": "If the transaction is not accepted by the Bitcoin network, the funds will be spendable again in your wallet. Depending on your wallet, this may take 48-72 hours.", "Invoice ID": "Invoice ID", "Order ID": "Order ID", - "Return to StoreName": "Return to {{storeName}}" + "Return to StoreName": "Return to {{storeName}}", + // Invoice paid + "This invoice has been paid": "This invoice has been paid", + // Invoice archived + "This invoice has been archived": "This invoice has been archived", + "Archived_Body": "Please contact the store for order information or assistance" };