From 0f32b042812f462ccb225af1f500c82e94919de5 Mon Sep 17 00:00:00 2001 From: Sol Irvine Date: Sun, 8 Oct 2023 15:32:09 +0900 Subject: [PATCH] fix: Reverse localization issues --- components/cart/index.tsx | 2 +- components/layout/navbar/language-control.tsx | 2 +- middleware.ts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/cart/index.tsx b/components/cart/index.tsx index d5e9103ef..f82c7a67f 100644 --- a/components/cart/index.tsx +++ b/components/cart/index.tsx @@ -14,7 +14,7 @@ export default async function Cart({ locale }: { locale?: SupportedLocale }) { const promotedItem: Product | undefined = await getProduct({ handle: 'gift-bag-and-postcard-set', - language: locale?.toUpperCase() || 'JA' + language: locale?.toUpperCase() || 'EN' }); return ; diff --git a/components/layout/navbar/language-control.tsx b/components/layout/navbar/language-control.tsx index 993fbf32a..13457f763 100644 --- a/components/layout/navbar/language-control.tsx +++ b/components/layout/navbar/language-control.tsx @@ -19,7 +19,7 @@ export const LanguageControl = ({ lang }: { lang?: SupportedLocale }) => { const basePathName = () => { const unjoined = pathName.split('/'); - const unjoinedWithoutLocale = removeItem(unjoined, 'en'); + const unjoinedWithoutLocale = removeItem(unjoined, 'ja'); return unjoinedWithoutLocale.join('/') || '/'; }; diff --git a/middleware.ts b/middleware.ts index f7520bddd..b0a3d6402 100644 --- a/middleware.ts +++ b/middleware.ts @@ -2,10 +2,10 @@ import createMiddleware from 'next-intl/middleware'; export default createMiddleware({ // A list of all locales that are supported - locales: ['ja', 'en'], + locales: ['en', 'ja'], // If this locale is matched, pathnames work without a prefix (e.g. `/about`) - defaultLocale: 'ja' + defaultLocale: 'en' }); export const config = {