switch default language

This commit is contained in:
Sol Irvine 2023-09-15 00:11:36 -04:00
parent 405d53fa58
commit 974300c4a2
4 changed files with 5 additions and 5 deletions

View File

@ -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))}

View File

@ -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} />;

View File

@ -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('/') || '/';
}; };

View File

@ -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 = {