Skip to content

Commit

Permalink
fix: Module fetching wrong menu URL when switching languages (#220)
Browse files Browse the repository at this point in the history
* fix: Fix module fetching wrong menu URL when switching languages.

* Add build files for testing.

* Remove dist

---------

Co-authored-by: Alexandru <[email protected]>
  • Loading branch information
TurtlBbx and vloss3 authored Apr 9, 2024
1 parent 5b668ee commit 970475a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/runtime/composables/useDrupalCe/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,12 @@ export const useDrupalCe = () => {
// API path with localization
menuPath.value = nuxtApp.$localePath('/' + baseMenuPath)
watch(nuxtApp.$i18n.locale, () => {
menuPath.value = nuxtApp.$localePath('/' + baseMenuPath)
let menuLocalePath = nuxtApp.$localePath('/' + baseMenuPath)
// menuPath should not start with a slash.
if (config.serverApiProxy && menuLocalePath.startsWith('/')) {
menuLocalePath = menuLocalePath.substring(1)
}
menuPath.value = menuLocalePath
})
}

Expand Down

0 comments on commit 970475a

Please sign in to comment.