-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Adjusting the interceptor and correcting sideWrapper translations
- Loading branch information
1 parent
1078b7c
commit 0c1db8e
Showing
8 changed files
with
50 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
"use client"; | ||
|
||
import { useRouter } from "next/navigation"; | ||
import { useEffect, useState } from "react"; | ||
|
||
import { getBrowserLang } from "../Internationalization"; | ||
import MainBg from "../MainBg"; | ||
|
||
export default function Intercepter() { | ||
const [isLoading, setIsLoading] = useState(false); | ||
const router = useRouter(); | ||
|
||
useEffect(() => { | ||
const browserLang = getBrowserLang(); | ||
|
||
const verify = (browserLang && | ||
(browserLang[0] === "pt" || browserLang[0] === "pt-BR")) as boolean; | ||
|
||
if (verify) { | ||
document.documentElement.lang = "pt"; | ||
setIsLoading(true); | ||
router.push("/pt"); | ||
setIsLoading(false); | ||
} | ||
}, []); | ||
|
||
if (isLoading) { | ||
return ( | ||
<MainBg> | ||
<></> | ||
</MainBg> | ||
); | ||
} | ||
|
||
return null; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters