This commit is contained in:
parent
85cf4c1a92
commit
b59e11c9a5
|
|
@ -33,7 +33,7 @@ export function LanguageSwitcher() {
|
||||||
const segments = pathname.split('/')
|
const segments = pathname.split('/')
|
||||||
|
|
||||||
// 如果路径前缀是语言码,则替换
|
// 如果路径前缀是语言码,则替换
|
||||||
const isLocaleInPath = i18nConfig.locales.includes(segments[1])
|
const isLocaleInPath = [...i18nConfig.locales].includes(segments[1])
|
||||||
if (isLocaleInPath) {
|
if (isLocaleInPath) {
|
||||||
segments[1] = newLocale
|
segments[1] = newLocale
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue