Skip to content

Commit 970475a

Browse files
fix: Module fetching wrong menu URL when switching languages (#220)
* fix: Fix module fetching wrong menu URL when switching languages. * Add build files for testing. * Remove dist --------- Co-authored-by: Alexandru <[email protected]>
1 parent 5b668ee commit 970475a

File tree

1 file changed

+6
-1
lines changed
  • src/runtime/composables/useDrupalCe

1 file changed

+6
-1
lines changed

src/runtime/composables/useDrupalCe/index.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,12 @@ export const useDrupalCe = () => {
129129
// API path with localization
130130
menuPath.value = nuxtApp.$localePath('/' + baseMenuPath)
131131
watch(nuxtApp.$i18n.locale, () => {
132-
menuPath.value = nuxtApp.$localePath('/' + baseMenuPath)
132+
let menuLocalePath = nuxtApp.$localePath('/' + baseMenuPath)
133+
// menuPath should not start with a slash.
134+
if (config.serverApiProxy && menuLocalePath.startsWith('/')) {
135+
menuLocalePath = menuLocalePath.substring(1)
136+
}
137+
menuPath.value = menuLocalePath
133138
})
134139
}
135140

0 commit comments

Comments
 (0)