---
title: "Languages · Sanity × Nuxt UI"
description: "How document translations, language prefixes, fallbacks and translated interface text work."
canonical_url: "https://sanity-nuxtui.vercel.app/docs/languages"
meta:
  "og:description": "How document translations, language prefixes, fallbacks and translated interface text work."
  "og:image": "https://sanity-nuxtui.vercel.app/_og/d/c_Page%2Ctitle_Languages%2Cdescription_~SG93IGRvY3VtZW50IHRyYW5zbGF0aW9ucywgbGFuZ3VhZ2UgcHJlZml4ZXMsIGZhbGxiYWNrcyBhbmQgdHJhbnNsYXRlZCBpbnRlcmZhY2UgdGV4dCB3b3JrLg%2Cheadline_Docs%2CsiteName_~U2FuaXR5IMOXIE51eHQgVUk%2Cp_Ii9kb2NzL2xhbmd1YWdlcyI%2Cs_jqOk9EbXCW9ydnhc.png"
  "og:image:height": "630"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "Languages · Sanity × Nuxt UI"
  "twitter:image": "https://sanity-nuxtui.vercel.app/_og/d/c_Page%2Ctitle_Languages%2Cdescription_~SG93IGRvY3VtZW50IHRyYW5zbGF0aW9ucywgbGFuZ3VhZ2UgcHJlZml4ZXMsIGZhbGxiYWNrcyBhbmQgdHJhbnNsYXRlZCBpbnRlcmZhY2UgdGV4dCB3b3JrLg%2Cheadline_Docs%2CsiteName_~U2FuaXR5IMOXIE51eHQgVUk%2Cp_Ii9kb2NzL2xhbmd1YWdlcyI%2Cs_jqOk9EbXCW9ydnhc.png"
---

> Index of every page on this site: [llms.txt](https://sanity-nuxtui.vercel.app/llms.txt)

[Docs](https://sanity-nuxtui.vercel.app/docs)

# **Languages**

How document translations, language prefixes, fallbacks and translated interface text work.

Languages are configured in the Studio, not in code: ****Site Settings → Languages**** holds the site language, the other languages and the fallback setting. Editors can turn them on without a deploy. See [**Translating content**](https://sanity-nuxtui.vercel.app/docs/translating-content) for the editor side.

## In the Studio

Pages, collections and entries are translated with [**@sanity/document-internationalization**](https://github.com/sanity-io/plugins/tree/main/plugins/%40sanity/document-internationalization): one document per language, each with a `language` field, linked by a `translation.metadata` document.

- `supportedLanguages` is read from Site Settings when the Studio loads ( `getLanguages()` in `schemaTypes/shared/language.ts`), so reload after changing languages.
- New documents start in the site language through the `language` field's initial value.
- Slugs only need to be unique within a language ( `isUniqueInLanguage`).
- When an entry is translated, the plugin's `callback` in `sanity.config.ts` points the copy at the collection's translation in the same language.
- Site Settings per language are documents with the IDs `settings-<language>`, listed by `structure.ts`.

Documents created before languages were turned on have no `language`. Queries treat them as the site language with `coalesce(language, $defaultLanguage)`.

## URLs

The site language has no prefix; every other language has its tag as the first segment.

|  | **Site language (**`en`**)** | **Other language (**`id`**)** |
| --- | --- | --- |
| Homepage | `/` | `/id` |
| Page | `/about` | `/id/tentang` |
| Entry | `/blog/hello` | `/id/blog/halo` |

`splitLanguagePath()` in `app/utils/language.ts` reads the language from a path, and `localePath()` adds it. A prefix for the site language (`/en/about`) redirects to the unprefixed URL; the Presentation tool links that way, since it does not know the site language.

## Queries

| **Parameter** | **Meaning** |
| --- | --- |
| `$language` | The language of the current URL |
| `$defaultLanguage` | The site language |
| `$languages` | Every language the site serves |
| `$fallback` | Show untranslated pages in the site language |

- `IN_LANGUAGE` selects documents in the current language.
- `translated('page')` follows a reference to its translation in the current language, falling back to the referenced document. Links and Collection List blocks use it, so they can point at one language and still follow the visitor.
- `TRANSLATIONS` lists the language versions of a document; the language switcher and the `hreflang` links use it.
- `find()` looks up a document in the current language, then, with `$fallback`, in the site language. The result's `language` tells the page it is showing a fallback, which then adds a note and `noindex`.

## Site Settings and interface text

`SETTINGS_QUERY` reads each translatable field from `settings-<language>` first and falls back to the main settings. Interface text (`labels`) is merged in `app.vue`: English defaults from `app/utils/labels.ts`, then the main settings, then the current language. Components read it with `useLabels()`:

```
const t = useLabels()t('photos', { count: 12 }) // "12 photos", or the translated label
```

To add a label, add it to `DEFAULT_LABELS` in `labels.ts` and to `LABELS` in the settings schema.

## Nuxt UI text

Nuxt UI translates its own text (close buttons, carousel arrows, the search placeholder) through locales. `modules/ui-locales.ts` generates one lazy import per Nuxt UI locale, and `loadUiLocale()` loads only the language being viewed, picking the closest match: `pt-BR` → `pt_br`, then `pt`, then English. `app.vue` passes it to `<UApp :locale>`.

## SEO

- `<html lang>` and `og:locale` follow the page language. Nuxt SEO sets them from its site config, which knows one language only, so `app.vue` rewrites the final tags in a `tags:resolve` hook.
- Pages with translations get `hreflang` links, with `x-default` on the site language.
- The sitemap lists every language and adds the translations of each URL as alternatives.

[**Theming** Colors, fonts, component styles and the motion utilities of the Swiss theme.](https://sanity-nuxtui.vercel.app/docs/theming) [**Visual Editing** Turn on the live preview in the Presentation tool, locally and in production.](https://sanity-nuxtui.vercel.app/docs/visual-editing)

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://sanity-nuxtui.vercel.app/#website","@type":"WebSite","name":"Sanity × Nuxt UI","url":"https://sanity-nuxtui.vercel.app/","publisher":{"@id":"https://sanity-nuxtui.vercel.app/#identity"}},{"@id":"https://sanity-nuxtui.vercel.app/docs/languages#webpage","@type":"WebPage","dateModified":"2026-10-16T02:29:18Z","description":"How document translations, language prefixes, fallbacks and translated interface text work.","name":"Languages","url":"https://sanity-nuxtui.vercel.app/docs/languages","isPartOf":{"@id":"https://sanity-nuxtui.vercel.app/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://sanity-nuxtui.vercel.app/docs/languages"]}]},{"@id":"https://sanity-nuxtui.vercel.app/#identity","@type":"Organization","name":"Sanity × Nuxt UI","url":"https://sanity-nuxtui.vercel.app"},{"@id":"https://sanity-nuxtui.vercel.app/docs/languages#article","@type":"Article","dateModified":"2026-10-16T02:29:18Z","description":"How document translations, language prefixes, fallbacks and translated interface text work.","headline":"Languages","inLanguage":"en","thumbnailUrl":"https://sanity-nuxtui.vercel.app/_og/d/c_Page%2Ctitle_Languages%2Cdescription_~SG93IGRvY3VtZW50IHRyYW5zbGF0aW9ucywgbGFuZ3VhZ2UgcHJlZml4ZXMsIGZhbGxiYWNrcyBhbmQgdHJhbnNsYXRlZCBpbnRlcmZhY2UgdGV4dCB3b3JrLg%2Cheadline_Docs%2CsiteName_~U2FuaXR5IMOXIE51eHQgVUk%2Cp_Ii9kb2NzL2xhbmd1YWdlcyI%2Cs_jqOk9EbXCW9ydnhc.png","author":{"@id":"https://sanity-nuxtui.vercel.app/#identity"},"image":{"@id":"https://sanity-nuxtui.vercel.app/#/schema/image/1"},"isPartOf":{"@id":"https://sanity-nuxtui.vercel.app/docs/languages#webpage"},"mainEntityOfPage":{"@id":"https://sanity-nuxtui.vercel.app/docs/languages#webpage"},"publisher":{"@id":"https://sanity-nuxtui.vercel.app/#identity"}},{"@id":"https://sanity-nuxtui.vercel.app/#/schema/image/1","@type":"ImageObject","contentUrl":"https://sanity-nuxtui.vercel.app/_og/d/c_Page%2Ctitle_Languages%2Cdescription_~SG93IGRvY3VtZW50IHRyYW5zbGF0aW9ucywgbGFuZ3VhZ2UgcHJlZml4ZXMsIGZhbGxiYWNrcyBhbmQgdHJhbnNsYXRlZCBpbnRlcmZhY2UgdGV4dCB3b3JrLg%2Cheadline_Docs%2CsiteName_~U2FuaXR5IMOXIE51eHQgVUk%2Cp_Ii9kb2NzL2xhbmd1YWdlcyI%2Cs_jqOk9EbXCW9ydnhc.png","inLanguage":"en","url":"https://sanity-nuxtui.vercel.app/_og/d/c_Page%2Ctitle_Languages%2Cdescription_~SG93IGRvY3VtZW50IHRyYW5zbGF0aW9ucywgbGFuZ3VhZ2UgcHJlZml4ZXMsIGZhbGxiYWNrcyBhbmQgdHJhbnNsYXRlZCBpbnRlcmZhY2UgdGV4dCB3b3JrLg%2Cheadline_Docs%2CsiteName_~U2FuaXR5IMOXIE51eHQgVUk%2Cp_Ii9kb2NzL2xhbmd1YWdlcyI%2Cs_jqOk9EbXCW9ydnhc.png"}]}
```

## Sitemap

See the full [sitemap](https://sanity-nuxtui.vercel.app/sitemap.md) for all pages.
