We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f6c5672 commit c5dc386Copy full SHA for c5dc386
1 file changed
src/client/theme-default/slots/LangSwitch/index.tsx
@@ -23,7 +23,8 @@ function getTargetLocalePath({
23
}) {
24
const clearPath =
25
'base' in current
26
- ? pathname.replace(current.base.replace(/\/$/, ''), '')
+ ? // handle '/en-US/a' => '/a' or '/en-US' => '' => '/'
27
+ pathname.replace(current.base.replace(/\/$/, ''), '') || '/'
28
: pathname.replace(new RegExp(`${current.suffix}$`), '');
29
30
return 'base' in target
0 commit comments