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

View File

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

View File

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

View File

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