mirror of
https://github.com/vercel/commerce.git
synced 2025-05-14 21:47:51 +00:00
switch default language
This commit is contained in:
parent
405d53fa58
commit
974300c4a2
@ -41,7 +41,7 @@ export function AddManyToCart({
|
|||||||
return (
|
return (
|
||||||
<div className="flex flex-col space-y-2">
|
<div className="flex flex-col space-y-2">
|
||||||
<div className="font-multilingual flex flex-row items-center space-x-2 border border-white/50">
|
<div className="font-multilingual flex flex-row items-center space-x-2 border border-white/50">
|
||||||
<div className="w-[80px] px-3">{t('cart.quantity-label')}</div>
|
<div className="w-[100px] px-3">{t('cart.quantity-label')}</div>
|
||||||
<input
|
<input
|
||||||
value={currentQuantity}
|
value={currentQuantity}
|
||||||
onChange={(e) => setCurrentQuantity(Number(e.target.value))}
|
onChange={(e) => setCurrentQuantity(Number(e.target.value))}
|
||||||
|
@ -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() || 'EN'
|
language: locale?.toUpperCase() || 'JA'
|
||||||
});
|
});
|
||||||
|
|
||||||
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, 'ja');
|
const unjoinedWithoutLocale = removeItem(unjoined, 'en');
|
||||||
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: ['en', 'ja'],
|
locales: ['ja', 'en'],
|
||||||
|
|
||||||
// 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: 'en'
|
defaultLocale: 'ja'
|
||||||
});
|
});
|
||||||
|
|
||||||
export const config = {
|
export const config = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user