Skip to content

Commit 6796d47

Browse files
committed
fix: LanguageSwitcher — use router.push instead of replace for reliable navigation
1 parent 0de3df2 commit 6796d47

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

platform/src/components/LanguageSwitcher.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use client'
22

33
import { useLocale, useTranslations } from 'next-intl'
4-
import { usePathname, useRouter } from '@/i18n/navigation'
4+
import { useRouter, usePathname } from '@/i18n/navigation'
55

66
export default function LanguageSwitcher() {
77
const t = useTranslations('languageSwitcher')
@@ -12,7 +12,7 @@ export default function LanguageSwitcher() {
1212
const otherLocale = locale === 'en' ? 'zh' : 'en'
1313

1414
const switchLocale = () => {
15-
// 使用 push 而不是 replace,确保导航发生
15+
// Use push instead of replace for more reliable navigation
1616
router.push(pathname, { locale: otherLocale })
1717
}
1818

0 commit comments

Comments
 (0)