mirror of
https://github.com/vercel/commerce.git
synced 2025-05-14 21:47:51 +00:00
Merge pull request #10 from zenzen-sol/sol/preview-localization-fix
fix: Reverse preview localization issues
This commit is contained in:
commit
8a60e55d73
@ -14,7 +14,7 @@ export default async function Cart({ locale }: { locale?: SupportedLocale }) {
|
|||||||
|
|
||||||
const promotedItem: Product | undefined = await getProduct({
|
const promotedItem: Product | undefined = await getProduct({
|
||||||
handle: 'gift-bag-and-postcard-set',
|
handle: 'gift-bag-and-postcard-set',
|
||||||
language: locale?.toUpperCase() || 'JA'
|
language: locale?.toUpperCase() || 'EN'
|
||||||
});
|
});
|
||||||
|
|
||||||
return <CartModal cart={cart} promotedItem={promotedItem} />;
|
return <CartModal cart={cart} promotedItem={promotedItem} />;
|
||||||
|
@ -19,7 +19,7 @@ export const LanguageControl = ({ lang }: { lang?: SupportedLocale }) => {
|
|||||||
|
|
||||||
const basePathName = () => {
|
const basePathName = () => {
|
||||||
const unjoined = pathName.split('/');
|
const unjoined = pathName.split('/');
|
||||||
const unjoinedWithoutLocale = removeItem(unjoined, 'en');
|
const unjoinedWithoutLocale = removeItem(unjoined, 'ja');
|
||||||
return unjoinedWithoutLocale.join('/') || '/';
|
return unjoinedWithoutLocale.join('/') || '/';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -2,10 +2,10 @@ import createMiddleware from 'next-intl/middleware';
|
|||||||
|
|
||||||
export default createMiddleware({
|
export default createMiddleware({
|
||||||
// A list of all locales that are supported
|
// 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`)
|
// If this locale is matched, pathnames work without a prefix (e.g. `/about`)
|
||||||
defaultLocale: 'ja'
|
defaultLocale: 'en'
|
||||||
});
|
});
|
||||||
|
|
||||||
export const config = {
|
export const config = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user