# Locale urls on nuxt

**URL:** <https://community.prismic.io/t/locale-urls-on-nuxt/3239>\
**Category:** Developing with Prismic\
**Tags:** nuxtjs\
**Created:** [December 17, 2020, 5:48pm UTC](https://community.prismic.io/t/locale-urls-on-nuxt/3239 "2020-12-17T17:48:17Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![fausto](https://avatars.discourse-cdn.com/v4/letter/f/f6c823/32.png) [@fausto](https://community.prismic.io/u/fausto)\
**Post date:** [December 17, 2020, 5:48pm UTC](https://community.prismic.io/t/locale-urls-on-nuxt/3239/1 "2020-12-17T17:48:17Z")

</div>

Hi, we are using prismic with nuxt to build landing pages on our site. So we need to translate the pages urls to make links.

Is there any way to use the localePath from the i18n library to get one page uid in other language?

Thanks

---

<div class="post-metadata">

**Author:** ![Pau](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/pau/32/5422_2.png) [@Pau](https://community.prismic.io/u/Pau)\
**Post date:** [December 18, 2020, 2:55am UTC](https://community.prismic.io/t/locale-urls-on-nuxt/3239/2 "2020-12-18T02:55:53Z")

</div>

Hey Fausto, welcome to the Forum!

Have you tried working with `switchLocalePath` ? Quoting Nuxt: – It returns a link to the current page in another language. [I found this piece of information in this page](https://i18n.nuxtjs.org/basic-usage).

I'm guessing you're using the UIDs to build the URLs, right? Are these UIDs all the same between languages or not?

---

<div class="post-metadata">

**Author:** ![fausto](https://avatars.discourse-cdn.com/v4/letter/f/f6c823/32.png) [@fausto](https://community.prismic.io/u/fausto)\
**Post date:** [December 18, 2020, 2:06pm UTC](https://community.prismic.io/t/locale-urls-on-nuxt/3239/4 "2020-12-18T14:06:16Z")

</div>

Thanks Paulina!

The problem is that the UIDs are different for each language, for example, on english it might be "hello", in spanish "hola" and so on.

So when i need to make a link to that page, i need to use something like localePath("hello") and that should return /hello when the site is in english and /hola when the site is in spanish.

Thanks!

---

<div class="post-metadata">

**Author:** ![Pau](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/pau/32/5422_2.png) [@Pau](https://community.prismic.io/u/Pau)\
**Post date:** [December 19, 2020, 8:01pm UTC](https://community.prismic.io/t/locale-urls-on-nuxt/3239/5 "2020-12-19T20:01:56Z")

</div>

Ok I see, I think accessing the alternate languages of each document will help you build this routes. Have you seen our multi language example that uses Nuxt.js?

Check it out and see how we handle this dynamic routes:

> **[Multi-language website with Nuxt and Prismic](https://intercom.help/prismicio/en/articles/2929806-multi-language-website-with-nuxt-and-prismic)**
>
> Want to get a multi language website up and running easily using Prismic and Nuxt?

Here's a simple example of how you can retrieve the `alternate_languages` from a query:

```
  async asyncData({ $prismic, error }) {
    try {
      // Query to get post content
      const result = await $prismic.api.getByUID('page', params.uid)

      return {
        doc: result.data.body,
        altLangs: result.alternate_languages
      };
    } catch (e) {
      // Returns error page
      error({ statusCode: 404, message: "Page not found" });
    }
  }

```

Then, you just need to pass it to the link resolver:  
`<nuxt-link :to="$prismic.linkResolver(altLang)">`

---

<div class="post-metadata">

**Author:** ![Pau](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/pau/32/5422_2.png) [@Pau](https://community.prismic.io/u/Pau)\
**Post date:** [December 27, 2020, 8:19pm UTC](https://community.prismic.io/t/locale-urls-on-nuxt/3239/6 "2020-12-27T20:19:52Z")

</div>

This issue has been closed due to inactivity. [Flag to reopen](https://community.prismic.io/t/re-open-a-thread/2175).

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/system/32/1746_2.png) [@system](https://community.prismic.io/u/system)\
**Post date:** [December 9, 2021, 4:49pm UTC](https://community.prismic.io/t/locale-urls-on-nuxt/3239/8 "2021-12-09T16:49:15Z")

</div>


