diff --git a/next-i18next.config.ts b/next-i18next.config.ts index 7f29f16..b34cf5e 100644 --- a/next-i18next.config.ts +++ b/next-i18next.config.ts @@ -5,7 +5,7 @@ const nextI18NextConfig: UserConfig = { i18n: { locales: ['ko', 'en'], defaultLocale: 'ko', - localeDetection: false, // 리터럴 false + localeDetection: false, }, reloadOnPrerender: process.env.NODE_ENV === 'development', localePath: path.resolve('./public/locales'), diff --git a/next.config.ts b/next.config.ts index 7b5e3d2..eabcbf2 100644 --- a/next.config.ts +++ b/next.config.ts @@ -8,6 +8,11 @@ const nextConfig: NextConfig = { }; return config; }, + i18n: { + locales: ['ko', 'en'], + defaultLocale: 'ko', + localeDetection: false, + }, reactStrictMode: true, images: { remotePatterns: [ diff --git a/src/components/localeSwitcher.tsx b/src/components/localeSwitcher.tsx index 2d32f4a..3fd0ec6 100644 --- a/src/components/localeSwitcher.tsx +++ b/src/components/localeSwitcher.tsx @@ -1,21 +1,17 @@ +import Link from 'next/link'; import { useRouter } from 'next/router'; const LocaleSwitcher = () => { - const { locale, locales, asPath, pathname, query, push } = useRouter(); + const { locale, locales, pathname, query } = useRouter(); const supported = locales ?? ['ko', 'en']; const nextLocale = supported.find((l) => l !== locale) ?? supported[0]; - const handleClick = () => { - push({ pathname, query }, asPath, { locale: nextLocale }); - }; - return ( - + + + ); };