mirror of
https://github.com/Infisical/infisical.git
synced 2025-03-25 14:05:03 +00:00
chore(frontend): add useEffect to _app for translate
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user