mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-03 13:26:02 +00:00
chore(frontend): add useEffect to _app for translate
This commit is contained in:
+8
-10
@@ -17,16 +17,14 @@ config.autoAddCss = false;
|
|||||||
const App = ({ Component, pageProps, ...appProps }) => {
|
const App = ({ Component, pageProps, ...appProps }) => {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
// useEffect(() => {
|
useEffect(() => {
|
||||||
// const storedLang = localStorage.getItem("lang");
|
const storedLang = localStorage.getItem("lang");
|
||||||
// console.log(router.locale);
|
if (router.locale ?? "en" !== storedLang ?? "en") {
|
||||||
// console.log(storedLang);
|
router.push(router.pathname, router.pathname, {
|
||||||
// if (router.locale ?? "en" !== storedLang ?? "en") {
|
locale: storedLang ?? "en",
|
||||||
// router.push(router.pathname, router.pathname, {
|
});
|
||||||
// locale: storedLang ?? "en",
|
}
|
||||||
// });
|
}, [router.locale, router.pathname]);
|
||||||
// }
|
|
||||||
// }, [router.locale, router.pathname]);
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// Init for auto capturing
|
// Init for auto capturing
|
||||||
|
|||||||
Reference in New Issue
Block a user