skills/nuxt-i18n/SKILL.md
Add internationalization (i18n) to a Nuxt 3 project — install @nuxtjs/i18n, extract hardcoded strings from components into locale JSON files, configure routing strategy, create a language switcher component, and fix hosting config for SSR locale routes. Use this skill whenever the user wants to translate a Nuxt site, add multiple languages, add a language switcher, localize content, or migrate a monolingual Nuxt site to multilingual. Also triggers when adding specific languages (e.g., "add German to my site") or when the user mentions i18n, localization, or translation in a Nuxt context.
npx skillsauth add razbakov/skills nuxt-i18nInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Add multi-language support to any Nuxt 3 project. This skill covers the full workflow from installing the module to deploying translated SSR routes.
Before writing any code, scan all components and pages for hardcoded strings. Use the Grep tool to find text content in Vue templates:
Pattern: ">[^<{]*[a-zA-Z][^<{]*<"
Glob: "*.vue"
Path: components/ and pages/
Catalog every user-facing string:
nuxt.config.ts and useHead() callsCheck the lockfile to determine the package manager, then install:
pnpm add @nuxtjs/i18n # if pnpm-lock.yaml exists
npm install @nuxtjs/i18n # if package-lock.json exists
yarn add @nuxtjs/i18n # if yarn.lock exists
Create i18n/locales/ directory with a JSON file per language. Start with the default language (usually en.json), then translate.
i18n/
└── locales/
├── en.json # Source language
├── de.json
├── fr.json
└── ...
Structure keys semantically by component or section:
{
"nav": {
"home": "Home",
"about": "About",
"contact": "Contact"
},
"hero": {
"title": "Welcome to our platform",
"subtitle": "Build something amazing",
"cta": "Get Started"
},
"form": {
"name": "Your name",
"email": "your{'@'}email.com",
"submit": "Submit",
"errors": {
"nameRequired": "Name is required",
"emailInvalid": "Please enter a valid email"
}
},
"meta": {
"title": "My Website",
"description": "A brief description of the site"
}
}
Key conventions:
"items": { "0": { "title": "..." }, "1": { ... } } or JSON arrays@ as {'@'} — it's a vue-i18n special character for linked messages"items": "no items | {count} item | {count} items" (pipe-separated forms)"greeting": "Hello, {name}!" then $t('greeting', { name: userName })Add the i18n module with lazy-loaded locale files. Adapt the locale list to the project's target languages:
export default defineNuxtConfig({
modules: [
// ...existing modules,
'@nuxtjs/i18n'
],
i18n: {
locales: [
{ code: 'en', language: 'en-US', file: 'en.json', name: 'English' },
{ code: 'de', language: 'de-DE', file: 'de.json', name: 'Deutsch' },
// Add more as needed
],
defaultLocale: 'en',
strategy: 'prefix_except_default',
lazy: true,
langDir: 'locales',
detectBrowserLanguage: {
useCookie: true,
cookieKey: 'i18n_redirected',
redirectOn: 'root',
},
},
})
Strategy choice: prefix_except_default means the default locale has no prefix (/) while others get prefixed (/de/, /fr/). This preserves existing URLs and is the most common choice. Other options: prefix (all locales get prefix), no_prefix (no URL differentiation — locale from cookie/header only).
Replace every hardcoded string with $t('key.path'). In <script setup>, use useI18n():
<script setup>
const { t } = useI18n()
// For reactive arrays/objects that use translations, wrap in computed()
// so they update when the user switches language:
const features = computed(() => [
{ title: t('features.item1.title'), desc: t('features.item1.desc') },
{ title: t('features.item2.title'), desc: t('features.item2.desc') },
])
</script>
<template>
<h1>{{ $t('hero.title') }}</h1>
<p>{{ $t('hero.subtitle') }}</p>
<button>{{ $t('form.submit') }}</button>
<input :placeholder="$t('form.email')" />
</template>
Important patterns:
{{ $t('key') }}:placeholder="$t('form.email')"const { t } = useI18n() then t('key')computed(), translated content won't update when the user switches locale$t('greeting', { name: userName })$t('items', { count: itemCount })useLocalePath() or <NuxtLinkLocale> to preserve locale prefix in <NuxtLink> hrefsUpdate useHead() calls with computed wrapping — this ensures meta tags react to locale changes:
<script setup>
const { t } = useI18n()
useHead(computed(() => ({
title: t('meta.title'),
meta: [
{ name: 'description', content: t('meta.description') },
{ property: 'og:title', content: t('meta.title') },
{ property: 'og:description', content: t('meta.description') },
],
})))
</script>
The computed() wrapper is important here — without it, meta tags won't update when the user switches language via the switcher.
Create a switcher component. Adapt the styling to match the project's design system (the example below uses minimal inline styles — replace with Tailwind, UnoCSS, or plain CSS as appropriate):
<script setup>
const { locale, locales } = useI18n()
const switchLocalePath = useSwitchLocalePath()
</script>
<template>
<nav class="language-switcher" aria-label="Language">
<NuxtLink
v-for="loc in locales"
:key="loc.code"
:to="switchLocalePath(loc.code)"
:class="['lang-link', { active: locale === loc.code }]"
:aria-label="loc.name"
:aria-current="locale === loc.code ? 'true' : undefined"
>
{{ loc.code }}
</NuxtLink>
</nav>
</template>
Place the switcher in the site header/navigation. Style it to match the project's existing design — the component handles the locale switching logic, you handle the look and feel.
This step is critical — without it, locale routes like /de/ will 404 in production.
If using Netlify with SSR (nitro preset "netlify"), remove any catch-all redirect from netlify.toml:
# REMOVE this — it blocks SSR routes:
# [[redirects]]
# from = "/*"
# to = "/index.html"
# status = 200
# Correct config for Nuxt SSR on Netlify:
[build]
command = "pnpm install --frozen-lockfile && pnpm build"
publish = ".output/public"
[build.environment]
NODE_VERSION = "20"
The Nuxt Netlify preset handles routing via server functions automatically — no redirects needed.
Vercel with preset: 'vercel' handles SSR routes automatically. No special config needed.
With preset: 'cloudflare-pages', routes work automatically via Workers.
If using static generation, add prerender routes for each locale in nuxt.config.ts:
nitro: {
prerender: {
routes: ['/de', '/fr', '/es'],
crawlLinks: true,
}
}
# Build locally to catch errors
pnpm build
# Test locale routes in dev
pnpm dev
Verify each locale route:
Then deploy using the project's normal deployment method.
$t() / useI18n()computed() for reactivityuseHead() wrapped in computed() for reactive meta tagsdevelopment
Seed a new or empty Instagram account with a 9-post grid (3×3) so the profile looks established the moment a new visitor lands. Designed for festivals, new businesses, product launches, conferences, communities — any time an empty IG profile would hurt conversion from external traffic (QR scans, flyer drops, cross-promo). Generates assets via /image-from-gemini (per content-publishing rules — never HTML), writes captions with hashtag sets, and outputs a posting order + cadence plan. Trigger generously: phrases like '9 posts for instagram', 'fill my IG', 'starter grid', 'launch grid', 'instagram seed', '9-post grid', 'IG account not to look empty', 'first instagram posts', 'feed bootstrap', '3x3 grid', 'instagram launch content'. Even if the user mentions only one piece (just the images, just the captions, just the order), use this skill — the grid only works as an integrated bundle.
testing
Translate one English blog post into multiple target languages via parallel sub-agents, preserving frontmatter conventions, hero image, and brand voice. Use when the user shares a published English post URL or markdown path and says 'translate it', 'add other languages', 'publish in DE/ES/RU/UK', 'translate to 5 languages', or asks for localized versions of a specific post.
development
Build a complete press kit for an event, product launch, or campaign — in multiple languages — and publish it as a shareable Google Drive folder ready to send to journalists, partners, or a delegate. Produces press releases (typically DE/EN/ES, or configurable), uploads press photos and flyers, creates an Overview document for at-a-glance briefing, and creates a Handover document with pending tasks, contacts, risks, and decisions so press distribution can be delegated. Use when the user says 'I need a press release', 'create a press kit', 'press release in X languages', 'set up a Drive folder for press', 'handover doc for someone else to run press', or has an upcoming announcement that needs to be sent to media. Trigger generously: even partial requests (just a press release, just a flyer folder) typically evolve into the full kit.
development
Track ticket sales for a live event (concert, festival, conference, workshop) with daily snapshots, generate a burndown chart comparing actual sales to ideal-linear targets and tier-cumulative milestones, and report whether the event is on pace. Use when the user asks how sales are going, wants to know if their event will sell out, asks for a daily sales report, wants to set up sales tracking for an upcoming event, or asks about ticket pace / velocity / projection. Trigger generously: phrases like 'how is concert sales going', 'burndown for my event', 'are we going to sell out', 'sales velocity', 'daily ticket chart', 'how many tickets do we need to sell', or any case where the user has a ticketed event with a fixed sales window and wants visibility on pacing.