From 0a87cdc34733254ab176ae1109d5092e0d9d8a56 Mon Sep 17 00:00:00 2001 From: Unchained Date: Sun, 29 Mar 2026 08:55:20 +0200 Subject: [PATCH] fix: translate payment method names based on locale - Update PaymentMethodCard to use next-intl translations - Remove hardcoded English names from config - Add comingSoon translation key for unavailable methods - Payment names now match checkout language (SR/EN/DE/FR) --- src/components/payment/PaymentMethodCard.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/components/payment/PaymentMethodCard.tsx b/src/components/payment/PaymentMethodCard.tsx index 817f797..77cbbd5 100644 --- a/src/components/payment/PaymentMethodCard.tsx +++ b/src/components/payment/PaymentMethodCard.tsx @@ -3,6 +3,7 @@ import { cn } from "@/lib/utils"; import type { PaymentMethod } from "@/lib/saleor/payments/types"; import { Banknote, CreditCard, Building2, LucideIcon } from "lucide-react"; +import { useTranslations } from "next-intl"; // Icon mapping for payment methods const iconMap: Record = { @@ -26,8 +27,13 @@ export function PaymentMethodCard({ disabled = false, locale, }: PaymentMethodCardProps) { + const t = useTranslations("Payment"); const Icon = method.icon ? iconMap[method.icon] : Banknote; + // Get translated name and description based on method ID + const translatedName = t(`${method.id}.name`); + const translatedDescription = t(`${method.id}.description`); + return (