linkResolver with Nuxt to cover Language

Hello!

I have a linkResolver like so:

import { type LinkResolverFunction } from '@prismicio/client';

const linkResolver: LinkResolverFunction = (document) => {
  const language = document.lang === "en-eu" ? "/en" : "/de"

  switch (document.type) {
    case 'post':
      return language + "/blog/" + document.uid
    default:
      return null
  }
}

export default linkResolver

What I want to do here is make use of URLs with language identifiers de and en instead of de_de and en_us or something like it. Doing so I end up with the page rendering, but links not being active at all, they are just all missing URLs, the a tags have no hrefs.

Any suggestions?

Hi @jh1. Can you provide some more information to help with troubleshooting this? How are you rendering the links? What does the final HTML for your links look like?