From f99f2c81ac40fe80e470f9ee8d0a5e8b14186ba8 Mon Sep 17 00:00:00 2001 From: kernal053 Date: Tue, 26 Nov 2024 13:15:05 +0530 Subject: [PATCH 1/4] Add 'Voucher:' before voucher code on order confirmation emails --- app/views/spree/order_mailer/_order_summary.html.haml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/views/spree/order_mailer/_order_summary.html.haml b/app/views/spree/order_mailer/_order_summary.html.haml index 1c3b4c7480..724cfafb33 100644 --- a/app/views/spree/order_mailer/_order_summary.html.haml +++ b/app/views/spree/order_mailer/_order_summary.html.haml @@ -43,6 +43,8 @@ - checkout_adjustments_for(@order, exclude: [:line_item]).reverse_each do |adjustment| %tr %td{align: "right", colspan: "3"} + - if adjustment.originator_type == "Voucher" + = "#{t(:voucher)}:" = "#{adjustment.label}:" %td{align: "right"} = adjustment.display_amount From 65abda2a383f22d57fb9f919cd86827906c21528 Mon Sep 17 00:00:00 2001 From: kernal053 Date: Wed, 4 Dec 2024 21:35:34 +0530 Subject: [PATCH 2/4] add voucher label & correspoding code with translation for order confirmation mailer --- app/views/spree/order_mailer/_order_summary.html.haml | 3 +-- config/locales/cy.yml | 1 + config/locales/de_DE.yml | 1 + config/locales/el.yml | 1 + config/locales/en.yml | 1 + config/locales/en_CA.yml | 1 + config/locales/en_FR.yml | 1 + config/locales/en_GB.yml | 1 + config/locales/en_IE.yml | 1 + config/locales/es.yml | 1 + config/locales/fr.yml | 1 + config/locales/fr_BE.yml | 1 + config/locales/fr_CA.yml | 1 + config/locales/hi.yml | 1 + config/locales/hu.yml | 1 + config/locales/ml.yml | 1 + config/locales/mr.yml | 1 + config/locales/nb.yml | 1 + config/locales/pa.yml | 1 + config/locales/ru.yml | 1 + config/locales/sr.yml | 1 + 21 files changed, 21 insertions(+), 2 deletions(-) diff --git a/app/views/spree/order_mailer/_order_summary.html.haml b/app/views/spree/order_mailer/_order_summary.html.haml index 724cfafb33..aa1307dd0a 100644 --- a/app/views/spree/order_mailer/_order_summary.html.haml +++ b/app/views/spree/order_mailer/_order_summary.html.haml @@ -44,8 +44,7 @@ %tr %td{align: "right", colspan: "3"} - if adjustment.originator_type == "Voucher" - = "#{t(:voucher)}:" - = "#{adjustment.label}:" + = t(:email_order_summary_voucher_label, code: adjustment.label) %td{align: "right"} = adjustment.display_amount %tr diff --git a/config/locales/cy.yml b/config/locales/cy.yml index 1e61dbc621..56221277dc 100644 --- a/config/locales/cy.yml +++ b/config/locales/cy.yml @@ -2207,6 +2207,7 @@ cy: email_order_summary_subtotal: "Is-gyfanswm:" email_order_summary_total: "Cyfanswm:" email_order_summary_includes_tax: "(yn cynnwys treth):" + email_order_summary_voucher_label: "Taleb (%{code}):" email_payment_paid: TALWYD email_payment_not_paid: HEB EI DALU email_payment_description: Disgrifiad o'r tâl wrth y Ddesg Talu diff --git a/config/locales/de_DE.yml b/config/locales/de_DE.yml index c02235e93f..bdf7e47d9c 100644 --- a/config/locales/de_DE.yml +++ b/config/locales/de_DE.yml @@ -2187,6 +2187,7 @@ de_DE: email_order_summary_subtotal: "Zwischensumme:" email_order_summary_total: "Gesamt:" email_order_summary_includes_tax: "(inkl. Steuern):" + email_order_summary_voucher_label: "Gutschein (%{code}):" email_payment_paid: BEZAHLT email_payment_not_paid: NICHT BEZAHLT email_payment_description: 'Hinweise zur Zahlung ' diff --git a/config/locales/el.yml b/config/locales/el.yml index a751fca40c..3115eddb5d 100644 --- a/config/locales/el.yml +++ b/config/locales/el.yml @@ -2266,6 +2266,7 @@ el: email_order_summary_subtotal: "ΜΕΡΙΚΟ ΣΥΝΟΛΟ:" email_order_summary_total: "Σύνολο:" email_order_summary_includes_tax: "(περιλαμβάνει φόρο):" + email_order_summary_voucher_label: "Κουπόνι (%{code}):" email_payment_paid: επι πληρώμη email_payment_not_paid: ΑΠΛΗΡΩΤΟΣ email_payment_description: Περιγραφή πληρωμής στο ταμείο diff --git a/config/locales/en.yml b/config/locales/en.yml index 0fd20f5667..ad27ac5884 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -2499,6 +2499,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using email_order_summary_subtotal: "Subtotal:" email_order_summary_total: "Total:" email_order_summary_includes_tax: "(includes tax):" + email_order_summary_voucher_label: "Voucher (%{code}):" email_payment_paid: PAID email_payment_not_paid: NOT PAID email_payment_description: Payment Description at Checkout diff --git a/config/locales/en_CA.yml b/config/locales/en_CA.yml index d4040b3612..40dce92664 100644 --- a/config/locales/en_CA.yml +++ b/config/locales/en_CA.yml @@ -2375,6 +2375,7 @@ en_CA: email_order_summary_subtotal: "Subtotal:" email_order_summary_total: "Total:" email_order_summary_includes_tax: "(includes tax):" + email_order_summary_voucher_label: "Voucher (%{code}):" email_payment_paid: PAID email_payment_not_paid: NOT PAID email_payment_description: Payment Description at Checkout diff --git a/config/locales/en_FR.yml b/config/locales/en_FR.yml index 916d679cae..b791ce9009 100644 --- a/config/locales/en_FR.yml +++ b/config/locales/en_FR.yml @@ -2380,6 +2380,7 @@ en_FR: email_order_summary_subtotal: "Subtotal:" email_order_summary_total: "Total:" email_order_summary_includes_tax: "(includes tax):" + email_order_summary_voucher_label: "Voucher (%{code}):" email_payment_paid: PAID email_payment_not_paid: NOT PAID email_payment_description: Payment Description at Checkout diff --git a/config/locales/en_GB.yml b/config/locales/en_GB.yml index 7c7da26608..33726a698e 100644 --- a/config/locales/en_GB.yml +++ b/config/locales/en_GB.yml @@ -2366,6 +2366,7 @@ en_GB: email_order_summary_subtotal: "Subtotal:" email_order_summary_total: "Total:" email_order_summary_includes_tax: "(includes tax):" + email_order_summary_voucher_label: "Voucher (%{code}):" email_payment_paid: PAID email_payment_not_paid: NOT PAID email_payment_description: Payment Description at Checkout diff --git a/config/locales/en_IE.yml b/config/locales/en_IE.yml index 22442411d6..154027de96 100644 --- a/config/locales/en_IE.yml +++ b/config/locales/en_IE.yml @@ -2363,6 +2363,7 @@ en_IE: email_order_summary_subtotal: "Subtotal:" email_order_summary_total: "Total:" email_order_summary_includes_tax: "(includes tax):" + email_order_summary_voucher_label: "Voucher (%{code}):" email_payment_paid: PAID email_payment_not_paid: NOT PAID email_payment_description: Payment Description at Checkout diff --git a/config/locales/es.yml b/config/locales/es.yml index 23dfad9458..57be4f787e 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -2237,6 +2237,7 @@ es: email_order_summary_subtotal: "Subtotal:" email_order_summary_total: "Total:" email_order_summary_includes_tax: "(incluye impuestos):" + email_order_summary_voucher_label: "Bono (%{code}):" email_payment_paid: PAGADO email_payment_not_paid: NO PAGADO email_payment_description: Descripción de pago de la compra diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 30773111ea..e1ad1f65c0 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -2386,6 +2386,7 @@ fr: email_order_summary_subtotal: "Sous-total:" email_order_summary_total: "Total:" email_order_summary_includes_tax: "(dont TVA)" + email_order_summary_voucher_label: "Bon de réduction (%{code}):" email_payment_paid: RÉGLÉ email_payment_not_paid: NON RÉGLÉ email_payment_description: Informations concernant le mode de paiement diff --git a/config/locales/fr_BE.yml b/config/locales/fr_BE.yml index a63c2306c2..697c42250b 100644 --- a/config/locales/fr_BE.yml +++ b/config/locales/fr_BE.yml @@ -2101,6 +2101,7 @@ fr_BE: email_order_summary_subtotal: "Sous-total:" email_order_summary_total: "Total:" email_order_summary_includes_tax: "(dont TVA)" + email_order_summary_voucher_label: "Bon d'achat (%{code}):" email_payment_paid: RÉGLÉ email_payment_not_paid: NON RÉGLÉ email_payment_description: Description du paiement à la caisse diff --git a/config/locales/fr_CA.yml b/config/locales/fr_CA.yml index ebd2a02009..58cfe7a684 100644 --- a/config/locales/fr_CA.yml +++ b/config/locales/fr_CA.yml @@ -2374,6 +2374,7 @@ fr_CA: email_order_summary_subtotal: "Sous-total:" email_order_summary_total: "Total:" email_order_summary_includes_tax: "(dont Taxe)" + email_order_summary_voucher_label: "Bon de réduction (%{code}):" email_payment_paid: RÉGLÉ email_payment_not_paid: NON RÉGLÉ email_payment_description: Informations concernant le mode de paiement diff --git a/config/locales/hi.yml b/config/locales/hi.yml index 60d61a7a96..a432065ea3 100644 --- a/config/locales/hi.yml +++ b/config/locales/hi.yml @@ -2179,6 +2179,7 @@ hi: email_order_summary_subtotal: "उप-योग:" email_order_summary_total: "कुल:" email_order_summary_includes_tax: "(टैक्स सहित):" + email_order_summary_voucher_label: "वाउचर (%{code}):" email_payment_paid: भुगतान किया email_payment_not_paid: भुगतान नहीं किया गया email_payment_description: चेकआउट में भुगतान का विवरण diff --git a/config/locales/hu.yml b/config/locales/hu.yml index a52b9aff43..aefb5338a1 100644 --- a/config/locales/hu.yml +++ b/config/locales/hu.yml @@ -2309,6 +2309,7 @@ hu: email_order_summary_subtotal: "Részösszeg:" email_order_summary_total: "Összesen:" email_order_summary_includes_tax: "(adót tartalmaz):" + email_order_summary_voucher_label: "Kupon (%{code}):" email_payment_paid: FIZETETT email_payment_not_paid: NEM FIZETETT email_payment_description: Fizetési információk diff --git a/config/locales/ml.yml b/config/locales/ml.yml index 306a838576..f04aeaae73 100644 --- a/config/locales/ml.yml +++ b/config/locales/ml.yml @@ -2195,6 +2195,7 @@ ml: email_order_summary_subtotal: "അകെ തുക:" email_order_summary_total: "ആകെ:" email_order_summary_includes_tax: "(നികുതി ഉൾപ്പെടുന്നു):" + email_order_summary_voucher_label: "വൗച്ചർ (%{code}):" email_payment_paid: പണം നൽകി email_payment_not_paid: പണം നൽകിയിട്ടില്ല email_payment_description: ചെക്ക്ഔട്ടിലെ പേയ്മെന്റ് വിവരണം diff --git a/config/locales/mr.yml b/config/locales/mr.yml index 91508218ad..97daeea60c 100644 --- a/config/locales/mr.yml +++ b/config/locales/mr.yml @@ -2103,6 +2103,7 @@ mr: email_order_summary_subtotal: "सबटोटल:" email_order_summary_total: "टोटल:" email_order_summary_includes_tax: "(कर समावेश):" + email_order_summary_voucher_label: "व्हाउचर (%{code}):" email_payment_paid: पेड email_payment_not_paid: पैसे दिले नाहीत email_payment_description: चेकआउटवर पेमेंट वर्णन diff --git a/config/locales/nb.yml b/config/locales/nb.yml index a6520f4fe2..ff8f11a0f9 100644 --- a/config/locales/nb.yml +++ b/config/locales/nb.yml @@ -2363,6 +2363,7 @@ nb: email_order_summary_subtotal: "Delsum:" email_order_summary_total: "Sum:" email_order_summary_includes_tax: "(inkluderer avgift):" + email_order_summary_voucher_label: "Kupong (%{code}):" email_payment_paid: BETALT email_payment_not_paid: IKKE BETALT email_payment_description: Betalingsbeskrivelse i kassen diff --git a/config/locales/pa.yml b/config/locales/pa.yml index 21d4451762..f4fe7e4af2 100644 --- a/config/locales/pa.yml +++ b/config/locales/pa.yml @@ -2152,6 +2152,7 @@ pa: email_order_summary_subtotal: "ਉਪ-ਕੁੱਲ:" email_order_summary_total: "ਕੁੱਲ" email_order_summary_includes_tax: "(ਟੈਕਸ ਸਮੇਤ):" + email_order_summary_voucher_label: "ਵਾਊਚਰ (%{code}):" email_payment_paid: ਭੁਗਤਾਨ ਕੀਤਾ ਗਿਆ email_payment_not_paid: ਭੁਗਤਾਨ ਨਹੀਂ ਕੀਤਾ ਗਿਆ email_payment_description: ਚੈਕਆਉਟ ਤੇ ਭੁਗਤਾਨ ਦਾ ਵੇਰਵਾ diff --git a/config/locales/ru.yml b/config/locales/ru.yml index 22f702168a..9907e94359 100644 --- a/config/locales/ru.yml +++ b/config/locales/ru.yml @@ -2251,6 +2251,7 @@ ru: email_order_summary_subtotal: "Итого:" email_order_summary_total: "Всего:" email_order_summary_includes_tax: "(включает налог):" + email_order_summary_voucher_label: "Ваучер (%{code}):" email_payment_paid: ОПЛАЧЕН email_payment_not_paid: НЕ ОПЛАЧЕН email_payment_description: Описание Платежа при Оформлении Заказа diff --git a/config/locales/sr.yml b/config/locales/sr.yml index 031bab7999..2d8b56a2cc 100644 --- a/config/locales/sr.yml +++ b/config/locales/sr.yml @@ -2367,6 +2367,7 @@ sr: email_order_summary_subtotal: "међузбир:" email_order_summary_total: "Укупно:" email_order_summary_includes_tax: "(укључује порез):" + email_order_summary_voucher_label: "Ваучер (%{code}):" email_payment_paid: ПЛАЋЕН email_payment_not_paid: НЕПЛАЋЕН email_payment_description: Опис плаћања на благајни From 65f79802462c090b62f4042b45681b647f62c1ff Mon Sep 17 00:00:00 2001 From: kernal053 Date: Thu, 5 Dec 2024 08:18:52 +0530 Subject: [PATCH 3/4] remove locale files changes except en.yml inorder to avoid conflict with Transifex --- config/locales/cy.yml | 1 - config/locales/de_DE.yml | 1 - config/locales/el.yml | 1 - config/locales/en_CA.yml | 1 - config/locales/en_FR.yml | 1 - config/locales/en_GB.yml | 1 - config/locales/en_IE.yml | 1 - config/locales/es.yml | 1 - config/locales/fr.yml | 1 - config/locales/fr_BE.yml | 1 - config/locales/fr_CA.yml | 1 - config/locales/hi.yml | 1 - config/locales/hu.yml | 1 - config/locales/ml.yml | 1 - config/locales/mr.yml | 1 - config/locales/nb.yml | 1 - config/locales/pa.yml | 1 - config/locales/ru.yml | 1 - config/locales/sr.yml | 1 - 19 files changed, 19 deletions(-) diff --git a/config/locales/cy.yml b/config/locales/cy.yml index 56221277dc..1e61dbc621 100644 --- a/config/locales/cy.yml +++ b/config/locales/cy.yml @@ -2207,7 +2207,6 @@ cy: email_order_summary_subtotal: "Is-gyfanswm:" email_order_summary_total: "Cyfanswm:" email_order_summary_includes_tax: "(yn cynnwys treth):" - email_order_summary_voucher_label: "Taleb (%{code}):" email_payment_paid: TALWYD email_payment_not_paid: HEB EI DALU email_payment_description: Disgrifiad o'r tâl wrth y Ddesg Talu diff --git a/config/locales/de_DE.yml b/config/locales/de_DE.yml index bdf7e47d9c..c02235e93f 100644 --- a/config/locales/de_DE.yml +++ b/config/locales/de_DE.yml @@ -2187,7 +2187,6 @@ de_DE: email_order_summary_subtotal: "Zwischensumme:" email_order_summary_total: "Gesamt:" email_order_summary_includes_tax: "(inkl. Steuern):" - email_order_summary_voucher_label: "Gutschein (%{code}):" email_payment_paid: BEZAHLT email_payment_not_paid: NICHT BEZAHLT email_payment_description: 'Hinweise zur Zahlung ' diff --git a/config/locales/el.yml b/config/locales/el.yml index 3115eddb5d..a751fca40c 100644 --- a/config/locales/el.yml +++ b/config/locales/el.yml @@ -2266,7 +2266,6 @@ el: email_order_summary_subtotal: "ΜΕΡΙΚΟ ΣΥΝΟΛΟ:" email_order_summary_total: "Σύνολο:" email_order_summary_includes_tax: "(περιλαμβάνει φόρο):" - email_order_summary_voucher_label: "Κουπόνι (%{code}):" email_payment_paid: επι πληρώμη email_payment_not_paid: ΑΠΛΗΡΩΤΟΣ email_payment_description: Περιγραφή πληρωμής στο ταμείο diff --git a/config/locales/en_CA.yml b/config/locales/en_CA.yml index 40dce92664..d4040b3612 100644 --- a/config/locales/en_CA.yml +++ b/config/locales/en_CA.yml @@ -2375,7 +2375,6 @@ en_CA: email_order_summary_subtotal: "Subtotal:" email_order_summary_total: "Total:" email_order_summary_includes_tax: "(includes tax):" - email_order_summary_voucher_label: "Voucher (%{code}):" email_payment_paid: PAID email_payment_not_paid: NOT PAID email_payment_description: Payment Description at Checkout diff --git a/config/locales/en_FR.yml b/config/locales/en_FR.yml index b791ce9009..916d679cae 100644 --- a/config/locales/en_FR.yml +++ b/config/locales/en_FR.yml @@ -2380,7 +2380,6 @@ en_FR: email_order_summary_subtotal: "Subtotal:" email_order_summary_total: "Total:" email_order_summary_includes_tax: "(includes tax):" - email_order_summary_voucher_label: "Voucher (%{code}):" email_payment_paid: PAID email_payment_not_paid: NOT PAID email_payment_description: Payment Description at Checkout diff --git a/config/locales/en_GB.yml b/config/locales/en_GB.yml index 33726a698e..7c7da26608 100644 --- a/config/locales/en_GB.yml +++ b/config/locales/en_GB.yml @@ -2366,7 +2366,6 @@ en_GB: email_order_summary_subtotal: "Subtotal:" email_order_summary_total: "Total:" email_order_summary_includes_tax: "(includes tax):" - email_order_summary_voucher_label: "Voucher (%{code}):" email_payment_paid: PAID email_payment_not_paid: NOT PAID email_payment_description: Payment Description at Checkout diff --git a/config/locales/en_IE.yml b/config/locales/en_IE.yml index 154027de96..22442411d6 100644 --- a/config/locales/en_IE.yml +++ b/config/locales/en_IE.yml @@ -2363,7 +2363,6 @@ en_IE: email_order_summary_subtotal: "Subtotal:" email_order_summary_total: "Total:" email_order_summary_includes_tax: "(includes tax):" - email_order_summary_voucher_label: "Voucher (%{code}):" email_payment_paid: PAID email_payment_not_paid: NOT PAID email_payment_description: Payment Description at Checkout diff --git a/config/locales/es.yml b/config/locales/es.yml index 57be4f787e..23dfad9458 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -2237,7 +2237,6 @@ es: email_order_summary_subtotal: "Subtotal:" email_order_summary_total: "Total:" email_order_summary_includes_tax: "(incluye impuestos):" - email_order_summary_voucher_label: "Bono (%{code}):" email_payment_paid: PAGADO email_payment_not_paid: NO PAGADO email_payment_description: Descripción de pago de la compra diff --git a/config/locales/fr.yml b/config/locales/fr.yml index e1ad1f65c0..30773111ea 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -2386,7 +2386,6 @@ fr: email_order_summary_subtotal: "Sous-total:" email_order_summary_total: "Total:" email_order_summary_includes_tax: "(dont TVA)" - email_order_summary_voucher_label: "Bon de réduction (%{code}):" email_payment_paid: RÉGLÉ email_payment_not_paid: NON RÉGLÉ email_payment_description: Informations concernant le mode de paiement diff --git a/config/locales/fr_BE.yml b/config/locales/fr_BE.yml index 697c42250b..a63c2306c2 100644 --- a/config/locales/fr_BE.yml +++ b/config/locales/fr_BE.yml @@ -2101,7 +2101,6 @@ fr_BE: email_order_summary_subtotal: "Sous-total:" email_order_summary_total: "Total:" email_order_summary_includes_tax: "(dont TVA)" - email_order_summary_voucher_label: "Bon d'achat (%{code}):" email_payment_paid: RÉGLÉ email_payment_not_paid: NON RÉGLÉ email_payment_description: Description du paiement à la caisse diff --git a/config/locales/fr_CA.yml b/config/locales/fr_CA.yml index 58cfe7a684..ebd2a02009 100644 --- a/config/locales/fr_CA.yml +++ b/config/locales/fr_CA.yml @@ -2374,7 +2374,6 @@ fr_CA: email_order_summary_subtotal: "Sous-total:" email_order_summary_total: "Total:" email_order_summary_includes_tax: "(dont Taxe)" - email_order_summary_voucher_label: "Bon de réduction (%{code}):" email_payment_paid: RÉGLÉ email_payment_not_paid: NON RÉGLÉ email_payment_description: Informations concernant le mode de paiement diff --git a/config/locales/hi.yml b/config/locales/hi.yml index a432065ea3..60d61a7a96 100644 --- a/config/locales/hi.yml +++ b/config/locales/hi.yml @@ -2179,7 +2179,6 @@ hi: email_order_summary_subtotal: "उप-योग:" email_order_summary_total: "कुल:" email_order_summary_includes_tax: "(टैक्स सहित):" - email_order_summary_voucher_label: "वाउचर (%{code}):" email_payment_paid: भुगतान किया email_payment_not_paid: भुगतान नहीं किया गया email_payment_description: चेकआउट में भुगतान का विवरण diff --git a/config/locales/hu.yml b/config/locales/hu.yml index aefb5338a1..a52b9aff43 100644 --- a/config/locales/hu.yml +++ b/config/locales/hu.yml @@ -2309,7 +2309,6 @@ hu: email_order_summary_subtotal: "Részösszeg:" email_order_summary_total: "Összesen:" email_order_summary_includes_tax: "(adót tartalmaz):" - email_order_summary_voucher_label: "Kupon (%{code}):" email_payment_paid: FIZETETT email_payment_not_paid: NEM FIZETETT email_payment_description: Fizetési információk diff --git a/config/locales/ml.yml b/config/locales/ml.yml index f04aeaae73..306a838576 100644 --- a/config/locales/ml.yml +++ b/config/locales/ml.yml @@ -2195,7 +2195,6 @@ ml: email_order_summary_subtotal: "അകെ തുക:" email_order_summary_total: "ആകെ:" email_order_summary_includes_tax: "(നികുതി ഉൾപ്പെടുന്നു):" - email_order_summary_voucher_label: "വൗച്ചർ (%{code}):" email_payment_paid: പണം നൽകി email_payment_not_paid: പണം നൽകിയിട്ടില്ല email_payment_description: ചെക്ക്ഔട്ടിലെ പേയ്മെന്റ് വിവരണം diff --git a/config/locales/mr.yml b/config/locales/mr.yml index 97daeea60c..91508218ad 100644 --- a/config/locales/mr.yml +++ b/config/locales/mr.yml @@ -2103,7 +2103,6 @@ mr: email_order_summary_subtotal: "सबटोटल:" email_order_summary_total: "टोटल:" email_order_summary_includes_tax: "(कर समावेश):" - email_order_summary_voucher_label: "व्हाउचर (%{code}):" email_payment_paid: पेड email_payment_not_paid: पैसे दिले नाहीत email_payment_description: चेकआउटवर पेमेंट वर्णन diff --git a/config/locales/nb.yml b/config/locales/nb.yml index ff8f11a0f9..a6520f4fe2 100644 --- a/config/locales/nb.yml +++ b/config/locales/nb.yml @@ -2363,7 +2363,6 @@ nb: email_order_summary_subtotal: "Delsum:" email_order_summary_total: "Sum:" email_order_summary_includes_tax: "(inkluderer avgift):" - email_order_summary_voucher_label: "Kupong (%{code}):" email_payment_paid: BETALT email_payment_not_paid: IKKE BETALT email_payment_description: Betalingsbeskrivelse i kassen diff --git a/config/locales/pa.yml b/config/locales/pa.yml index f4fe7e4af2..21d4451762 100644 --- a/config/locales/pa.yml +++ b/config/locales/pa.yml @@ -2152,7 +2152,6 @@ pa: email_order_summary_subtotal: "ਉਪ-ਕੁੱਲ:" email_order_summary_total: "ਕੁੱਲ" email_order_summary_includes_tax: "(ਟੈਕਸ ਸਮੇਤ):" - email_order_summary_voucher_label: "ਵਾਊਚਰ (%{code}):" email_payment_paid: ਭੁਗਤਾਨ ਕੀਤਾ ਗਿਆ email_payment_not_paid: ਭੁਗਤਾਨ ਨਹੀਂ ਕੀਤਾ ਗਿਆ email_payment_description: ਚੈਕਆਉਟ ਤੇ ਭੁਗਤਾਨ ਦਾ ਵੇਰਵਾ diff --git a/config/locales/ru.yml b/config/locales/ru.yml index 9907e94359..22f702168a 100644 --- a/config/locales/ru.yml +++ b/config/locales/ru.yml @@ -2251,7 +2251,6 @@ ru: email_order_summary_subtotal: "Итого:" email_order_summary_total: "Всего:" email_order_summary_includes_tax: "(включает налог):" - email_order_summary_voucher_label: "Ваучер (%{code}):" email_payment_paid: ОПЛАЧЕН email_payment_not_paid: НЕ ОПЛАЧЕН email_payment_description: Описание Платежа при Оформлении Заказа diff --git a/config/locales/sr.yml b/config/locales/sr.yml index 2d8b56a2cc..031bab7999 100644 --- a/config/locales/sr.yml +++ b/config/locales/sr.yml @@ -2367,7 +2367,6 @@ sr: email_order_summary_subtotal: "међузбир:" email_order_summary_total: "Укупно:" email_order_summary_includes_tax: "(укључује порез):" - email_order_summary_voucher_label: "Ваучер (%{code}):" email_payment_paid: ПЛАЋЕН email_payment_not_paid: НЕПЛАЋЕН email_payment_description: Опис плаћања на благајни From bad32e226e9355ac28fdb9f850f620e9daf6653d Mon Sep 17 00:00:00 2001 From: kernal053 Date: Tue, 10 Dec 2024 20:31:14 +0530 Subject: [PATCH 4/4] Fix label for other adjustments and add spec correspodingly --- .../order_mailer/_order_summary.html.haml | 2 ++ spec/mailers/order_mailer_spec.rb | 26 +++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/app/views/spree/order_mailer/_order_summary.html.haml b/app/views/spree/order_mailer/_order_summary.html.haml index aa1307dd0a..bf9b34c97d 100644 --- a/app/views/spree/order_mailer/_order_summary.html.haml +++ b/app/views/spree/order_mailer/_order_summary.html.haml @@ -45,6 +45,8 @@ %td{align: "right", colspan: "3"} - if adjustment.originator_type == "Voucher" = t(:email_order_summary_voucher_label, code: adjustment.label) + - else + = "#{adjustment.label}:" %td{align: "right"} = adjustment.display_amount %tr diff --git a/spec/mailers/order_mailer_spec.rb b/spec/mailers/order_mailer_spec.rb index 34206213d5..a991f8659d 100644 --- a/spec/mailers/order_mailer_spec.rb +++ b/spec/mailers/order_mailer_spec.rb @@ -257,4 +257,30 @@ RSpec.describe Spree::OrderMailer do end end end + + context "display adjustments" do + let(:order) { create(:order_with_totals_and_distribution, :completed) } + let(:voucher) { create(:voucher, enterprise: order.distributor) } + + before do + voucher.create_adjustment(voucher.code, order) + OrderManagement::Order::Updater.new(order).update_voucher + end + + let!(:confirmation_email_for_customer) { Spree::OrderMailer.confirm_email_for_customer(order) } + let!(:confirmation_email_for_shop) { Spree::OrderMailer.confirm_email_for_shop(order) } + let!(:cancellation_email) { Spree::OrderMailer.cancel_email(order) } + + it "includes Voucher text with label" do + expect(confirmation_email_for_customer.body).to include("Voucher (#{voucher.code}):") + expect(confirmation_email_for_shop.body).to include("Voucher (#{voucher.code}):") + expect(cancellation_email.body).to include("Voucher (#{voucher.code}):") + end + + it "includes Shipping label" do + expect(confirmation_email_for_customer.body).to include("Shipping:") + expect(confirmation_email_for_shop.body).to include("Shipping:") + expect(cancellation_email.body).to include("Shipping:") + end + end end