Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

chore(frontend): add useEffect to _app for translate

이강준cfea0dc66fda
diff --git a/frontend/pages/_app.js b/frontend/pages/_app.js
index 0d1eeee325..75a44f4a39 100644
--- a/frontend/pages/_app.js
+++ b/frontend/pages/_app.js
@@ -17,16 +17,14 @@ config.autoAddCss = false;
const App = ({ Component, pageProps, ...appProps }) => {
const router = useRouter();
- // useEffect(() => {
- // const storedLang = localStorage.getItem("lang");
- // console.log(router.locale);
- // console.log(storedLang);
- // if (router.locale ?? "en" !== storedLang ?? "en") {
- // router.push(router.pathname, router.pathname, {
- // locale: storedLang ?? "en",
- // });
- // }
- // }, [router.locale, router.pathname]);
+ useEffect(() => {
+ const storedLang = localStorage.getItem("lang");
+ if (router.locale ?? "en" !== storedLang ?? "en") {
+ router.push(router.pathname, router.pathname, {
+ locale: storedLang ?? "en",
+ });
+ }
+ }, [router.locale, router.pathname]);
useEffect(() => {
// Init for auto capturing