File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed
ecosystem/theme-default/src/client/components Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,6 @@ const useNavbarSelectLanguage = (): ComputedRef<ResolvedNavbarItem[]> => {
31
31
}
32
32
const currentPath = router .currentRoute .value .path
33
33
const currentFullPath = router .currentRoute .value .fullPath
34
- const currentHash = router .currentRoute .value .hash
35
34
36
35
const languageDropdown: ResolvedNavbarItem = {
37
36
text: themeLocale .value .selectLanguageText ?? ' unknown language' ,
@@ -65,8 +64,8 @@ const useNavbarSelectLanguage = (): ComputedRef<ResolvedNavbarItem[]> => {
65
64
if (
66
65
router .getRoutes ().some ((item ) => item .path === targetLocalePage )
67
66
) {
68
- // try to keep current hash across languages
69
- link = ` ${ targetLocalePage }${ currentHash } `
67
+ // try to keep current hash and params across languages
68
+ link = currentFullPath . replace ( currentPath , targetLocalePage )
70
69
} else {
71
70
link = targetThemeLocale .home ?? targetLocalePath
72
71
}
You can’t perform that action at this time.
0 commit comments