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 (
|
||||
<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="w-[80px] px-3">{t('cart.quantity-label')}</div>
|
||||
<div className="w-[100px] px-3">{t('cart.quantity-label')}</div>
|
||||
<input
|
||||
value={currentQuantity}
|
||||
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({
|
||||
handle: 'gift-bag-and-postcard-set',
|
||||
language: locale?.toUpperCase() || 'EN'
|
||||
language: locale?.toUpperCase() || 'JA'
|
||||
});
|
||||
|
||||
return <CartModal cart={cart} promotedItem={promotedItem} />;
|
||||
|
@ -19,7 +19,7 @@ export const LanguageControl = ({ lang }: { lang?: SupportedLocale }) => {
|
||||
|
||||
const basePathName = () => {
|
||||
const unjoined = pathName.split('/');
|
||||
const unjoinedWithoutLocale = removeItem(unjoined, 'ja');
|
||||
const unjoinedWithoutLocale = removeItem(unjoined, 'en');
|
||||
return unjoinedWithoutLocale.join('/') || '/';
|
||||
};
|
||||
|
||||
|
@ -2,10 +2,10 @@ import createMiddleware from 'next-intl/middleware';
|
||||
|
||||
export default createMiddleware({
|
||||
// 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`)
|
||||
defaultLocale: 'en'
|
||||
defaultLocale: 'ja'
|
||||
});
|
||||
|
||||
export const config = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user