{error}
- Return to Cart + {t("returnToCart")}- Add some items to your cart before checking out. -
+{t("emptyCartDescription")}
- Continue Shopping + {tc("continueShopping")}Confirming your payment...
+{t("confirmingPayment")}
Order #{order.number}
-- You will receive an email confirmation shortly. +
+ {t("orderNumber", { number: order.number })}
+{t("emailConfirmation")}
{item.options_text}
)} -Qty: {item.quantity}
++ {t("qty", { quantity: item.quantity })} +
@@ -231,7 +239,7 @@ export default function OrderPlacedPage({ params }: OrderPlacedPageProps) { {order.bill_address && (
@@ -259,7 +267,7 @@ export default function OrderPlacedPage({ params }: OrderPlacedPageProps) { {/* Actions */}
- Add an address for faster checkout. -
- +{t("noAddressesDescription")}
+- {getCardLabel(card.cc_type)} ending in {card.last_digits} + {t("cardEndingIn", { + label: getCardLabel(card.cc_type), + digits: card.last_digits, + })}
- Exp {String(card.month).padStart(2, "0")}/{card.year} + {t("cardExpires", { + month: String(card.month).padStart(2, "0"), + year: card.year, + })}
{card.name && ({card.name}
@@ -61,28 +70,28 @@ function CreditCardItem({- Payment methods are saved automatically when you make a purchase. -
+{t("noCardsDescription")}
- The link in the email will expire in 15 minutes. Check your spam - folder if you don't see it. -
+{t("linkExpiry")}
{card.expires_at - ? `Expires ${formatDate(card.expires_at)}` - : "No expiration date"} + ? t("expiresOn", { date: formatDate(card.expires_at, locale) }) + : t("noExpiration")}
{card.display_amount_remaining}
-remaining
+{t("remaining")}
{usagePercentage}% used
++ {t("percentUsed", { percent: usagePercentage })} +
- You don't have any gift cards associated with your account yet. -
+{t("noGiftCardsDescription")}
{user?.first_name ? `${user.first_name} ${user.last_name || ""}`.trim() - : "My Account"} + : t("myAccount")}
{user?.email} @@ -125,7 +130,7 @@ function AccountShell({
- {getCardLabel(card.cc_type)} ending in {card.last_digits} + {t("cardEndingIn", { + label: getCardLabel(card.cc_type), + digits: card.last_digits, + })}
- Expires {String(card.month).padStart(2, "0")}/{card.year} + {t("cardExpires", { + month: String(card.month).padStart(2, "0"), + year: card.year, + })}
Store Credit
+{t("storeCredit")}
- Applied {payment.display_amount} — {credit.display_amount_remaining}{" "} - remaining + {t("storeCreditApplied", { + amount: payment.display_amount, + remaining: credit.display_amount_remaining, + })}
{item.options_text}
)} -Qty: {item.quantity}
++ {t("qty", { quantity: item.quantity })} +
- Order again + {t("orderAgain")}- {shipment.shipping_method?.name || "Canceled"} + {shipment.shipping_method?.name || + t("shippingMethodUnavailable")}
{shipment.stock_location && (- Shipped from {shipment.stock_location.name} + {t("shippedFrom", { location: shipment.stock_location.name })}
)} - {shipment.state} + {t( + SHIPMENT_STATE_KEY[shipment.state] || "unknownShipmentStatus", + )}- The order you're looking for doesn't exist. -
+{t("orderNotFoundDescription")}
- Back to orders + {t("backToOrders")}- Placed on {formatDate(order.completed_at)} + {t("placedOn", { date: formatDate(order.completed_at, locale) })}
{/* Shipments with line items */} @@ -354,7 +359,7 @@ export default function OrderDetailPage({ params }: OrderDetailPageProps) { {order.special_instructions && ({order.special_instructions}
- When you place orders, they will appear here. -
+{t("noOrdersDescription")}
- Don't have an account?{" "} + {t("dontHaveAccount")}{" "} - Sign up + {t("signUp")}
- View your past orders and track shipments + {t("orderHistoryDescription")}
- Manage your shipping and billing addresses + {t("addressesDescription")}
- Manage your saved credit cards + {t("paymentMethodsDescription")}
- Update your personal information + {t("profileDescription")}
Loading profile...
+{t("loadingProfile")}
- Already have an account?{" "} + {t("alreadyHaveAccount")}{" "} - Sign in + {t("signIn")}
- Looks like you haven't added anything to your cart yet. -
+{t("emptyCartDescription")}
- {getStoreDescription()} + {t("heroDescription")}
- {listing.totalCount}{" "} - {listing.totalCount === 1 ? "product" : "products"} found + {t("productsFound", { count: listing.totalCount })}
> ) : ( <> -Browse our complete collection
+{t("browseCollection")}
> )}Your cart is empty
+{t("emptyCart")}
+{t("emptyCartDescription")}
- Continue Shopping + {tc("continueShopping")}- Using your account email address + {t("usingAccountEmail")}
)}- Shipment {index + 1} of {shipments.length} + {t("shipmentOf", { + current: index + 1, + total: shipments.length, + })} {shipment.stock_location?.name && ( {" "} - — Ships from {shipment.stock_location.name} + —{" "} + {t("shipsFrom", { + location: shipment.stock_location.name, + })} )}
diff --git a/src/components/checkout/Summary.tsx b/src/components/checkout/Summary.tsx index 92d47cf0..c0e20ea8 100644 --- a/src/components/checkout/Summary.tsx +++ b/src/components/checkout/Summary.tsx @@ -1,6 +1,7 @@ "use client"; import type { Cart } from "@spree/sdk"; +import { useTranslations } from "next-intl"; import { ProductImage } from "@/components/ui/product-image"; interface SummaryProps { @@ -8,6 +9,8 @@ interface SummaryProps { } export function Summary({ cart }: SummaryProps) { + const tc = useTranslations("common"); + const t = useTranslations("checkout"); const items = cart.items || []; const hasShipping = (cart.shipments?.length ?? 0) > 0; @@ -50,38 +53,40 @@ export function Summary({ cart }: SummaryProps) { {/* Totals — Shopify style */}No products found.
+{t("noProductsFound")}
No products found.
+{emptyMessage}
{emptyMessage}
++ {emptyMessage || t("tryAdjustingFilters")} +
No more products to load
+{t("noMoreProducts")}
)}