This commit is contained in:
hailin 2025-04-17 17:56:12 +08:00
parent 1fb0a45aa9
commit 7d86e2b8d2
3 changed files with 3 additions and 0 deletions

View File

@ -6,6 +6,7 @@ import { useEffect, useTransition } from 'react'
import { Globe } from 'lucide-react'
export function LanguageSwitcher() {
console.log('home-redirecting to 2==========================>')
const router = useRouter()
const pathname = usePathname()
const [isPending, startTransition] = useTransition()

View File

@ -9,6 +9,7 @@ const isValidLocale = (locale: string): locale is (typeof i18nConfig.locales)[nu
}
export default function HomeRedirector() {
console.log('home-redirecting to 1==========================>')
const router = useRouter()
useEffect(() => {

View File

@ -4,6 +4,7 @@ import { NextResponse, type NextRequest } from "next/server"
import i18nConfig from "./i18nConfig"
export async function middleware(request: NextRequest) {
console.log('home-redirecting to 3==========================>')
const { pathname } = request.nextUrl
const preferredLanguage = request.cookies.get("preferred-language")?.value