We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0de3df2 commit 6796d47Copy full SHA for 6796d47
1 file changed
platform/src/components/LanguageSwitcher.tsx
@@ -1,7 +1,7 @@
1
'use client'
2
3
import { useLocale, useTranslations } from 'next-intl'
4
-import { usePathname, useRouter } from '@/i18n/navigation'
+import { useRouter, usePathname } from '@/i18n/navigation'
5
6
export default function LanguageSwitcher() {
7
const t = useTranslations('languageSwitcher')
@@ -12,7 +12,7 @@ export default function LanguageSwitcher() {
12
const otherLocale = locale === 'en' ? 'zh' : 'en'
13
14
const switchLocale = () => {
15
- // 使用 push 而不是 replace,确保导航发生
+ // Use push instead of replace for more reliable navigation
16
router.push(pathname, { locale: otherLocale })
17
}
18
0 commit comments