# Multi Language website and getSingle

**URL:** <https://community.prismic.io/t/multi-language-website-and-getsingle/11524>\
**Category:** Developing with Prismic\
**Tags:** nuxtjs\
**Created:** [October 31, 2022, 8:54pm UTC](https://community.prismic.io/t/multi-language-website-and-getsingle/11524 "2022-10-31T20:54:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![grafik](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/grafik/32/2875_2.png) [@grafik](https://community.prismic.io/u/grafik)\
**Post date:** [October 31, 2022, 8:54pm UTC](https://community.prismic.io/t/multi-language-website-and-getsingle/11524/1 "2022-10-31T20:54:42Z")

</div>

Hi there, I am creating a multi language website in English and Spanish (using slice machine)

My pages folder structure setup is as below:

```auto
pages/
├─ _lang/
│ ├─ index.vue
│ ├─ _uid.vue
│ ├─ visit/
│ │ ├─ index.vue

├─ _uid.vue
├─ index.vue
├─ visit/
│ ├─ index.vue

```

Homepage & \_uid work fine, but I'm running into problems with accessing the Spanish versions of the /visit/ page using $prismic.api.getSingle.

I can access the English page perfectly at [http://localhost:3000/en-us/visit](http://localhost:3000/en-us/visit)

But when I switch language to Spanish it comes unstuck at: [http://localhost:3000/es-ar/visitar](http://localhost:3000/es-ar/visitar) with a 'This page could not be found' error

However using the english doc.uid [http://localhost:3000/es-ar/visit/](http://localhost:3000/es-ar/visit/) works

I don't want to hardcode anything and for this project, I really need dynamic UID's between languages

\_lang/visit/index.vue is setup as follows:

```auto
 async asyncData({ $prismic, params, error }) {
    const visit = await $prismic.api.getSingle("visit", { lang: params.lang });

    const translations = visit.alternate_languages;

    return { visit, translations, lang: visit.lang };
  },

```

And my link-resolver as below:

```auto
export default function (doc) {

  if (doc.type === "home") {
    return `/${doc.lang}`;
  }

  if (doc.type === "page") {
    return `/${doc.lang}/page/${doc.uid}`;
  }

  if (doc.type === "visit") {
    return `/${doc.lang}/${doc.uid}`;
  }

  return "/not-found";
}

```

What am I doing wrong here? 🥴

Any tips would be greatly appreciated!

---

<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:** [October 31, 2022, 9:14pm UTC](https://community.prismic.io/t/multi-language-website-and-getsingle/11524/2 "2022-10-31T21:14:53Z")

</div>

Hello @grafik, are you missing a `_uid.vue` file inside `visit/` ?  
Please refer to our Nuxt internationalization documentation for some information:

> **[Internationalization with Nuxt](https://prismic.io/docs/technologies/nuxt-multilingual-templating)**
>
> This article collects all the resources you need to take advantage of Prismic's multi-language and localization feature when building a Nuxt.js website.

---

<div class="post-metadata">

**Author:** ![grafik](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/grafik/32/2875_2.png) [@grafik](https://community.prismic.io/u/grafik)\
**Post date:** [October 31, 2022, 9:32pm UTC](https://community.prismic.io/t/multi-language-website-and-getsingle/11524/4 "2022-10-31T21:32:31Z")

</div>

Hi Pau, thanks,

I've added those files inside /visit/, so my structure is now as follows:

```auto
pages/
├─ _lang/
│ ├─ index.vue
│ ├─ _uid.vue
│ ├─ visit/
│ │ ├─ index.vue
│ │ ├─ _uid.vue

├─ _uid.vue
├─ index.vue
├─ visit/
│ ├─ index.vue
│ ├─ _uid.vue

```

But I still get the same error on [http://localhost:3000/es-ar/visitar](http://localhost:3000/es-ar/visitar)

 ![Screen Shot 2022-11-01 at 10.29.20 AM](https://europe1.discourse-cdn.com/flex013/uploads/prismic/original/2X/9/9eaea39f5ca6fea342e8571130a2d500567368fe.png)

Where [http://localhost:3000/es-ar/visit](http://localhost:3000/es-ar/visit) works fine (but obviously has the wrong slug)

I also tried adding a route resolver as per that example you sent, but that doesn't appear to help:

```auto
apiOptions: {
      routes: [
        {
          type: "home",
          path: "/:lang?",
        },
        {
          type: "page",
          path: "/:lang?/:uid",
        },
        {
          type: "visit",
          path: "/:lang?/:uid",
        },
      ],
    },

```

---

<div class="post-metadata">

**Author:** ![grafik](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/grafik/32/2875_2.png) [@grafik](https://community.prismic.io/u/grafik)\
**Post date:** [October 31, 2022, 9:40pm UTC](https://community.prismic.io/t/multi-language-website-and-getsingle/11524/5 "2022-10-31T21:40:30Z")

</div>

I also noticed in the example here: [Internationalization with Nuxt - Documentation - Prismic](https://prismic.io/docs/technologies/nuxt-multilingual-templating)

That the 'about' page is not a single type, more like a \_page repeatable type, any examples of a single types that are not the homepage?

---

<div class="post-metadata">

**Author:** ![grafik](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/grafik/32/2875_2.png) [@grafik](https://community.prismic.io/u/grafik)\
**Post date:** [November 1, 2022, 8:53pm UTC](https://community.prismic.io/t/multi-language-website-and-getsingle/11524/6 "2022-11-01T20:53:50Z")

</div>

Hi there, any further insights would be greatly appreciated.

Should I be using predicate as opposed to getSingle ?

---

<div class="post-metadata">

**Author:** ![grafik](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/grafik/32/2875_2.png) [@grafik](https://community.prismic.io/u/grafik)\
**Post date:** [November 9, 2022, 1:18am UTC](https://community.prismic.io/t/multi-language-website-and-getsingle/11524/7 "2022-11-09T01:18:00Z")

</div>

I ended up using a single \_uid for all the pages, and then I build each page with slices.

It seems that the multi-language does not work with Single content types.
