Foundations

Translations

How the interface is translated, where each string lives and how to add a language.

The template uses @nuxtjs/i18n with the no_prefix strategy: URLs stay the same in every language (no /en/ or /es/). The language comes from the browser the first time and is then stored in the i18n_redirected cookie.

Where strings live

Interface strings are split by domain, one folder per language:

text
locales/
├─ en/
│  ├─ common.json      Buttons, form rules, toasts, customizer, shared labels
│  ├─ nav.json         Menu items and sections
│  ├─ auth.json        Login, register, roles
│  ├─ dashboard.json   The four dashboards
│  ├─ forms.json       Form examples
│  ├─ apps.json        Email, chat, calendar, kanban, tasks, files
│  ├─ admin.json       Orders, products, customers, invoices, learning
│  ├─ account.json     Profile, settings, pricing, team
│  ├─ help.json        Help center articles
│  ├─ landing.json     Landing chrome (cookie banner, widgets)
│  └─ ui.json          The component showcase
└─ es/                 The same files in Spanish

The list of files is LOCALE_FILES in config/locales.config.ts. A new file must be added there.

Use a string

vue
<template>
  <BaseButton>{{ $t('actions.save') }}</BaseButton>
  <p>{{ $t('orders.count', { count: total }) }}</p>
</template>

<script setup lang="ts">
const { t } = useI18n()

const title = computed(() => t('nav.orders'))
</script>

npm run lint fails when a key you use does not exist in locales/, so missing translations never reach production.

Chrome versus content

locales/ holds the interface. Marketing copy for the landing pages lives in content/<landing>/<code>.ts because you rewrite it for your product. Mock data stores semantic ids ('desktop', 'mon', 'totalUsers'), never translation keys or labels; the page resolves the label. This way, swapping a mock for a real API never leaks keys into the UI.

Vuetify's own messages

Vuetify ships translations for its components (pagination, date picker, “No data available”…). i18n.config.ts merges them from LOCALE_PACKS in config/locale-packs.config.ts under $vuetify, so they switch with the rest of the app.

Add a language

Adding French takes four steps:

  1. Add the language to APP_LOCALES in config/locales.config.ts. nuxt.config.ts builds the i18n locales from this list. language is the lang of the page and the SEO locale, and formatLocale is the regional variant used to format numbers and amounts through useFormatLocale() (Spanish uses es-419 and es-EC, so 1440 in dollars reads $1.440,00):
config/locales.config.ts
export const APP_LOCALES = [
  { code: 'en', language: 'en-US', formatLocale: 'en-US', name: 'English', flag: '/flags/us.svg' },
  { code: 'es', language: 'es-419', formatLocale: 'es-EC', name: 'Español', flag: '/flags/es.svg' },
  { code: 'fr', language: 'fr-FR', formatLocale: 'fr-FR', name: 'Français', flag: '/flags/fr.svg' },
] as const satisfies readonly AppLocale[]
  1. Copy locales/en/ to locales/fr/ and translate the values.
  2. Add a flag to public/flags/fr.svg.
  3. Add its Vuetify messages and its dayjs locale to LOCALE_PACKS. Vuetify translates its components with the first, and relative dates such as “3 days ago” use the second:
config/locale-packs.config.ts
import dayjsEs from 'dayjs/locale/es.js'
import dayjsFr from 'dayjs/locale/fr.js'
import { en, es, fr } from 'vuetify/locale'

export const LOCALE_PACKS: Record<string, LocalePack> = {
  en: { vuetify: en },
  es: { vuetify: es, dayjs: dayjsEs },
  fr: { vuetify: fr, dayjs: dayjsFr },
}

The language switcher reads useI18n().locales, so it shows the new language without any change. For a landing page, add a fr.ts module in its content/ folder too.

A test checks every language
tests/unit/locales.test.ts fails when a language in APP_LOCALES misses a message file, its flag, its Vuetify messages or its dayjs locale, or when a folder in locales/ is not listed. Run npm run test after adding one, and npm run lint to find the keys left untranslated.

Right-to-left languages

Direction is an appearance option, independent of the language, so you can test RTL in English. See Appearance.

© 2026 melsami UI.
Developer documentation for melsami UI.