From 3120efedcd17fc8946d655e499ea6205773fd153 Mon Sep 17 00:00:00 2001 From: PJaneta Date: Tue, 20 Aug 2024 14:39:43 +0200 Subject: [PATCH] AD-288 Implement Translation Support in Adyen Library for Spartacus Storefront - change to translations kept in ts files --- ...{adyen-checkout.json => adyen-checkout.ts} | 2 +- .../src/lib/assets/translations/en/index.ts | 7 +++-- .../translations/en/payment-errors.json | 27 ------------------- .../assets/translations/en/payment-errors.ts | 27 +++++++++++++++++++ 4 files changed, 31 insertions(+), 32 deletions(-) rename projects/adyen-payments/src/lib/assets/translations/en/{adyen-checkout.json => adyen-checkout.ts} (93%) delete mode 100644 projects/adyen-payments/src/lib/assets/translations/en/payment-errors.json create mode 100644 projects/adyen-payments/src/lib/assets/translations/en/payment-errors.ts diff --git a/projects/adyen-payments/src/lib/assets/translations/en/adyen-checkout.json b/projects/adyen-payments/src/lib/assets/translations/en/adyen-checkout.ts similarity index 93% rename from projects/adyen-payments/src/lib/assets/translations/en/adyen-checkout.json rename to projects/adyen-payments/src/lib/assets/translations/en/adyen-checkout.ts index b2549b6..0eaf872 100644 --- a/projects/adyen-payments/src/lib/assets/translations/en/adyen-checkout.json +++ b/projects/adyen-payments/src/lib/assets/translations/en/adyen-checkout.ts @@ -1,4 +1,4 @@ -{ +export const adyenCheckout = { "adyenCheckout": { "selectBillingAddress": "Select your billing address", "selectAddress": "Select address", diff --git a/projects/adyen-payments/src/lib/assets/translations/en/index.ts b/projects/adyen-payments/src/lib/assets/translations/en/index.ts index cbf1454..7e9986c 100644 --- a/projects/adyen-payments/src/lib/assets/translations/en/index.ts +++ b/projects/adyen-payments/src/lib/assets/translations/en/index.ts @@ -1,7 +1,6 @@ -// @ts-ignore -import adyenCheckout from './adyen-checkout.json'; -// @ts-ignore -import paymentErrors from './payment-errors.json'; +import {adyenCheckout} from "./adyen-checkout"; +import {paymentErrors} from "./payment-errors"; + export const en = { adyenCheckout, diff --git a/projects/adyen-payments/src/lib/assets/translations/en/payment-errors.json b/projects/adyen-payments/src/lib/assets/translations/en/payment-errors.json deleted file mode 100644 index e6f25e9..0000000 --- a/projects/adyen-payments/src/lib/assets/translations/en/payment-errors.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "checkout": { - "error": { - "authorization": { - "payment": { - "refused": "The payment is REFUSED.", - "detail": { - "not": { - "found": "The payment is REFUSED because the saved card is removed. Please try an other payment method." - } - } - }, - "restricted": { - "card": "The card is restricted." - }, - "cvc": { - "declined": "The payment is REFUSED. Please check your Card details." - }, - "transaction": { - "not": { - "permitted": "The transaction is not permitted." - } - } - } - } - } -} diff --git a/projects/adyen-payments/src/lib/assets/translations/en/payment-errors.ts b/projects/adyen-payments/src/lib/assets/translations/en/payment-errors.ts new file mode 100644 index 0000000..1d4aa66 --- /dev/null +++ b/projects/adyen-payments/src/lib/assets/translations/en/payment-errors.ts @@ -0,0 +1,27 @@ +export const paymentErrors = { + "checkout": { + "error": { + "authorization": { + "payment": { + "refused": "The payment is REFUSED.", + "detail": { + "not": { + "found": "The payment is REFUSED because the saved card is removed. Please try an other payment method." + } + } + }, + "restricted": { + "card": "The card is restricted." + }, + "cvc": { + "declined": "The payment is REFUSED. Please check your Card details." + }, + "transaction": { + "not": { + "permitted": "The transaction is not permitted." + } + } + } + } +} +}