[Vuejs]-How to use `localePath()` for a dynamic nuxt i18n route?

1👍

I’m assuming you’re using Nuxt3. First try redefining your pages like:

  'rental/[id]': {
    nl: '/verhuur/[id]',
    en: '/rental/[id]',
    de: '/mietbestand/[id]',
  },

Also, don’t forget to add this to your setup:

const localePath = useLocalePath()

If that doesn’t work try doing localePath({ name: 'rental-id', params: { id: '123' } })

Leave a comment