diff --git a/src/app/[countryCode]/(checkout)/checkout/page.tsx b/src/app/[countryCode]/(checkout)/checkout/page.tsx
index a6009a14e..e1ed9a1e6 100644
--- a/src/app/[countryCode]/(checkout)/checkout/page.tsx
+++ b/src/app/[countryCode]/(checkout)/checkout/page.tsx
@@ -1,7 +1,9 @@
import { Metadata } from "next"
import { cookies } from "next/headers"
import { notFound } from "next/navigation"
-import { LineItem } from "@medusajs/medusa"
+import { Cart, LineItem } from "@medusajs/medusa"
+
+import { getI18n } from "../../../../locales/server"
import { enrichLineItems } from "@modules/cart/actions"
import Wrapper from "@modules/checkout/components/payment-wrapper"
@@ -31,6 +33,9 @@ const fetchCart = async () => {
}
export default async function Checkout() {
+ const t = await getI18n()
+ metadata.title = t("checkout.title")
+
const cart = await fetchCart()
if (!cart) {
diff --git a/src/app/[countryCode]/(checkout)/layout.tsx b/src/app/[countryCode]/(checkout)/layout.tsx
index 53793dbd8..d61846842 100644
--- a/src/app/[countryCode]/(checkout)/layout.tsx
+++ b/src/app/[countryCode]/(checkout)/layout.tsx
@@ -2,11 +2,15 @@ import LocalizedClientLink from "@modules/common/components/localized-client-lin
import ChevronDown from "@modules/common/icons/chevron-down"
import MedusaCTA from "@modules/layout/components/medusa-cta"
-export default function CheckoutLayout({
+import { getI18n } from "../../../locales/server"
+
+export default async function CheckoutLayout({
children,
}: {
children: React.ReactNode
}) {
+ const t = await getI18n()
+
return (
@@ -18,10 +22,10 @@ export default function CheckoutLayout({
>
- Back to shopping cart
+ {t("checkout.back")}
- Back
+ {t("generic.back")}
- Medusa Store
+ {t("store.name")}
-
{children}
+
+ {children}
+
diff --git a/src/app/[countryCode]/(checkout)/not-found.tsx b/src/app/[countryCode]/(checkout)/not-found.tsx
index 838c9683e..c1b6619d2 100644
--- a/src/app/[countryCode]/(checkout)/not-found.tsx
+++ b/src/app/[countryCode]/(checkout)/not-found.tsx
@@ -1,19 +1,26 @@
+import { getI18n } from "../../../locales/server"
import InteractiveLink from "@modules/common/components/interactive-link"
import { Metadata } from "next"
export const metadata: Metadata = {
title: "404",
- description: "Something went wrong",
+ description: "generic.somethingwrong",
}
export default async function NotFound() {
+ const t = await getI18n()
+
+ metadata.description = t("generic.somethingwrong")
+
return (
-
Page not found
+
+ {t("generic.notfound_title")}
+
- The page you tried to access does not exist.
+ {t("generic.notfound_desc")}
- View and update your shipping addresses, you can add as many as you
- like. Saving your addresses will make them available during checkout.
+ {t("page.adresses.shipping.desc")}
diff --git a/src/app/[countryCode]/(main)/account/@dashboard/orders/details/[id]/page.tsx b/src/app/[countryCode]/(main)/account/@dashboard/orders/details/[id]/page.tsx
index 62321209b..31dbf12e9 100644
--- a/src/app/[countryCode]/(main)/account/@dashboard/orders/details/[id]/page.tsx
+++ b/src/app/[countryCode]/(main)/account/@dashboard/orders/details/[id]/page.tsx
@@ -1,6 +1,8 @@
import { Metadata } from "next"
import { notFound } from "next/navigation"
+import { getI18n } from "../../../../../../../../locales/server"
+
import { retrieveOrder } from "@lib/data"
import OrderDetailsTemplate from "@modules/order/templates/order-details-template"
@@ -9,6 +11,7 @@ type Props = {
}
export async function generateMetadata({ params }: Props): Promise {
+ const t = await getI18n()
const order = await retrieveOrder(params.id).catch(() => null)
if (!order) {
@@ -16,8 +19,8 @@ export async function generateMetadata({ params }: Props): Promise {
}
return {
- title: `Order #${order.display_id}`,
- description: `View your order`,
+ title: t("page.order.title") + ` #${order.display_id}`,
+ description: t("page.order.desc"),
}
}
diff --git a/src/app/[countryCode]/(main)/account/@dashboard/orders/page.tsx b/src/app/[countryCode]/(main)/account/@dashboard/orders/page.tsx
index 7e5c082bb..6829c3255 100644
--- a/src/app/[countryCode]/(main)/account/@dashboard/orders/page.tsx
+++ b/src/app/[countryCode]/(main)/account/@dashboard/orders/page.tsx
@@ -1,15 +1,21 @@
import { Metadata } from "next"
+import { getI18n } from "../../../../../../locales/server"
+
import OrderOverview from "@modules/account/components/order-overview"
import { listCustomerOrders } from "@lib/data"
import { notFound } from "next/navigation"
export const metadata: Metadata = {
- title: "Orders",
- description: "Overview of your previous orders.",
+ title: "page.orders.title",
+ description: "page.orders.desc",
}
export default async function Orders() {
+ const t = await getI18n()
+ metadata.title = t("page.orders.title")
+ metadata.description = t("page.orders.desc")
+
const orders = await listCustomerOrders()
if (!orders) {
@@ -19,11 +25,8 @@ export default async function Orders() {
return (
-
Orders
-
- View your previous orders and their status. You can also create
- returns or exchanges for your orders if needed.
-
+
{t("page.orders.title")}
+
{t("page.orders.details")}
diff --git a/src/app/[countryCode]/(main)/account/@dashboard/page.tsx b/src/app/[countryCode]/(main)/account/@dashboard/page.tsx
index b90dd6b11..e6f94eacd 100644
--- a/src/app/[countryCode]/(main)/account/@dashboard/page.tsx
+++ b/src/app/[countryCode]/(main)/account/@dashboard/page.tsx
@@ -1,15 +1,21 @@
import { Metadata } from "next"
+import { getI18n } from "../../../../../locales/server"
+
import { getCustomer, listCustomerOrders } from "@lib/data"
import Overview from "@modules/account/components/overview"
import { notFound } from "next/navigation"
export const metadata: Metadata = {
- title: "Account",
- description: "Overview of your account activity.",
+ title: "page.account.title",
+ description: "page.account.desc",
}
export default async function OverviewTemplate() {
+ const t = await getI18n()
+ metadata.title = t("page.account.title")
+ metadata.description = t("page.account.desc")
+
const customer = await getCustomer().catch(() => null)
const orders = (await listCustomerOrders().catch(() => null)) || null
diff --git a/src/app/[countryCode]/(main)/account/@dashboard/profile/page.tsx b/src/app/[countryCode]/(main)/account/@dashboard/profile/page.tsx
index 58043712a..f5a9bb8b1 100644
--- a/src/app/[countryCode]/(main)/account/@dashboard/profile/page.tsx
+++ b/src/app/[countryCode]/(main)/account/@dashboard/profile/page.tsx
@@ -1,5 +1,7 @@
import { Metadata } from "next"
+import { getI18n } from "../../../../../../locales/server"
+
import ProfilePhone from "@modules/account//components/profile-phone"
import ProfileBillingAddress from "@modules/account/components/profile-billing-address"
import ProfileEmail from "@modules/account/components/profile-email"
@@ -10,11 +12,15 @@ import { getCustomer, listRegions } from "@lib/data"
import { notFound } from "next/navigation"
export const metadata: Metadata = {
- title: "Profile",
- description: "View and edit your Medusa Store profile.",
+ title: "page.profile.title",
+ description: "page.profile.desc",
}
export default async function Profile() {
+ const t = await getI18n()
+ metadata.title = t("page.profile.title")
+ metadata.description = t("page.profile.desc")
+
const customer = await getCustomer()
const regions = await listRegions()
@@ -25,12 +31,8 @@ export default async function Profile() {
return (
-
Profile
-
- View and update your profile information, including your name, email,
- and phone number. You can also update your billing address, or change
- your password.
-
+
{metadata.title}
+
{t("page.profile.details")}
diff --git a/src/app/[countryCode]/(main)/account/@login/page.tsx b/src/app/[countryCode]/(main)/account/@login/page.tsx
index 848e21235..3ea728c5f 100644
--- a/src/app/[countryCode]/(main)/account/@login/page.tsx
+++ b/src/app/[countryCode]/(main)/account/@login/page.tsx
@@ -1,12 +1,18 @@
import { Metadata } from "next"
+import { getI18n } from "../../../../../locales/server"
+
import LoginTemplate from "@modules/account/templates/login-template"
export const metadata: Metadata = {
- title: "Sign in",
- description: "Sign in to your Medusa Store account.",
+ title: "page.login.title",
+ description: "page.login.desc",
}
-export default function Login() {
+export default async function Login() {
+ const t = await getI18n()
+ metadata.title = t("page.login.title")
+ metadata.description = t("page.login.desc")
+
return
}
diff --git a/src/app/[countryCode]/(main)/cart/not-found.tsx b/src/app/[countryCode]/(main)/cart/not-found.tsx
index 91af293ef..e8947f9bf 100644
--- a/src/app/[countryCode]/(main)/cart/not-found.tsx
+++ b/src/app/[countryCode]/(main)/cart/not-found.tsx
@@ -1,21 +1,28 @@
import { Metadata } from "next"
+import { getI18n } from "../../../../locales/server"
+
import InteractiveLink from "@modules/common/components/interactive-link"
export const metadata: Metadata = {
title: "404",
- description: "Something went wrong",
+ description: "generic.somethingwrong",
}
-export default function NotFound() {
+export default async function NotFound() {
+ const t = await getI18n()
+
+ metadata.description = t("generic.somethingwrong")
+
return (
-
Page not found
+
+ {t("generic.notfound_title")}
+
- The cart you tried to access does not exist. Clear your cookies and try
- again.
+ {t("generic.notfound_desc_cart")}