From 76da4494634f7c8a71af14a8d111da17318ff3a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EA=B0=95=EC=A4=80?= Date: Tue, 27 Dec 2022 15:59:11 +0900 Subject: [PATCH] fix(frontend): provided href invalid error --- frontend/.gitignore | 2 ++ frontend/.vscode/settings.json | 7 ------- frontend/next-i18next.config.js | 3 +++ frontend/pages/_app.js | 2 +- 4 files changed, 6 insertions(+), 8 deletions(-) delete mode 100644 frontend/.vscode/settings.json diff --git a/frontend/.gitignore b/frontend/.gitignore index 83e774c8cf..5edd5a7fa3 100644 --- a/frontend/.gitignore +++ b/frontend/.gitignore @@ -32,3 +32,5 @@ yarn-error.log* .env.production.local .vercel .env.infisical + +.vscode \ No newline at end of file diff --git a/frontend/.vscode/settings.json b/frontend/.vscode/settings.json deleted file mode 100644 index b2ae7a5ea3..0000000000 --- a/frontend/.vscode/settings.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "i18n-ally.localesPaths": [ - "locales", - "public/locales" - ], - "i18n-ally.sourceLanguage": "en" -} \ No newline at end of file diff --git a/frontend/next-i18next.config.js b/frontend/next-i18next.config.js index 698cf62b1f..5de9c97bc7 100644 --- a/frontend/next-i18next.config.js +++ b/frontend/next-i18next.config.js @@ -10,6 +10,9 @@ module.exports = { defaultLocale: "en", locales: ["en", "ko"], }, + fallbackLng: { + default: ["en"], + }, reloadOnPrerender: process.env.NODE_ENV === "development", diff --git a/frontend/pages/_app.js b/frontend/pages/_app.js index 75a44f4a39..54ed7d5121 100644 --- a/frontend/pages/_app.js +++ b/frontend/pages/_app.js @@ -20,7 +20,7 @@ const App = ({ Component, pageProps, ...appProps }) => { useEffect(() => { const storedLang = localStorage.getItem("lang"); if (router.locale ?? "en" !== storedLang ?? "en") { - router.push(router.pathname, router.pathname, { + router.push(router.asPath, router.asPath, { locale: storedLang ?? "en", }); }