Translate Your Nuxt.js Site Overnight with SiteLocaleAI
TL;DR – With a single siteLocale.config.js file, SiteLocaleAI can translate a Nuxt.js marketing site, pre‑render SEO‑friendly pages, and localize prices on the fly. No massive translation JSON files, no build‑time i18n plugins, and no extra Node.js dependencies for WordPress‑style sites.
1. The Traditional Nuxt i18n Approach
| Pain Point | Typical Solution |
|---|---|
| Manual translations | Create en.json, fr.json, de.json … and import them into the Vue i18n plugin. |
| Build‑time bundling | Every language is bundled into the final JavaScript payload, inflating the bundle size. |
| SEO | Need ` generate static pages per locale or rely on client‑side rendering – both hurt crawlability. |
| Price localization | Write custom helpers for each currency and keep them in sync manually. |
This works for small projects, but as the number of locales grows, the maintenance overhead explodes. Adding a new language means editing dozens of files, re‑running the build, and waiting for the CI pipeline.
2. SiteLocaleAI’s One‑Config Solution
SiteLocaleAI flips the script. Instead of shipping static translation files, you ship runtime LLM calls that generate the text on demand. The library is framework‑agnostic, so it works the same in Nuxt, React, Vue, or even plain HTML.
2.1. Install the library (optional, for local dev only)
npm i @sitelocaleai/js
The library itself is just a few kilobytes; the heavy lifting happens in your own LLM API (Claude, GPT‑4o‑mini, etc.).
2.2. Create a single config file
// siteLocale.config.js
export default {
// Your LLM provider – the key stays on your server, never in the client bundle
llm: {
provider: "openai",
model: "gpt-4o-mini",
apiKey: process.env.OPENAI_API_KEY,
},
// Target locales – SiteLocaleAI will generate a translation for each on the locales: [
{ code: "en", name: "English" },
{ code: "fr", name: "Français" },
{ code: "de", name: "Deutsch" },
{ code: "es", name: "Español" },
],
// Price rounding rules – psychological pricing per currency
priceRounding: {
USD: (value) => Math.round(value * 0.99), // $9.99 instead of $10
EUR: (value) => Math.round(value * 0.95), // €9.95 instead of €10
GBP: (value) => Math.round(value * 0.98),
},
// SEO pre‑rendering CLI options (see below)
seo: {
enable: true,
outputDir: "dist/seo",
},
};
That’s it – no per‑page translation files, no extra Nuxt modules.
2.3. Plug the library into Nuxt
// nuxt.config.ts
import siteLocale from "./siteLocale.config";
export default defineNuxtConfig({
plugins: ["~/plugins/siteLocale.client.ts"],
runtimeConfig: {
public: {
siteLocale,
},
},
});
// plugins/siteLocale.client.ts
import { initSiteLocale } from "@sitelocaleai/js";
import config from "../siteLocale.config";
export default defineNuxtPlugin((nuxtApp) => {
initSiteLocale(config, nuxtApp);
});
Now any text node wrapped with the <Locale> component will be translated on the fly:
<template>
<h1><Locale key="hero.title">Welcome to Our Platform</Locale></h1>
<p><Locale key="hero.subtitle">Powerful tools for global growth.</Locale></p>
<price :price="199" currency="USD" />
</template>
The <Price> component automatically applies the rounding rules defined in the config.
3. SEO‑Ready Pre‑Rendering with the CLI
Search engines still love static HTML. SiteLocaleAI ships a CLI that crawls your routes, renders each locale, and writes the result to dist/seo. The generated files can be served directly to bots via a simple rewrite rule.
n siteLocaleai seo --config siteLocale.config.js
The CLI:
1. Loads the Nuxt app in headless mode.
2. Calls the LLM for every Locale key in each language.
3. Replaces <Price> with the rounded amount.
4. Saves the fully translated HTML.
You can then point your CDN (e.g., Cloudflare) to serve dist/seo for crawlers while regular users still get the dynamic version.
4. Why SiteLocaleAI Beats the Traditional Path for This Use Case
| Feature | Traditional Nuxt i18n | SiteLocaleAI |
|---|---|---|
| Setup time | Multiple JSON files + i18n plugin configuration (hours). | One config file (minutes). |
| Bundle size | Every locale adds ~30 KB to the JS bundle. | Only the JS library (≈5 KB); translations are generated at runtime. |
| Scalability | Adding a new language = new JSON + rebuild. | Add a locale entry in the config; the CLI re‑generates SEO pages instantly. |
| Price localization | Custom code per currency, easy to forget a locale. | Built‑in rounding callbacks per currency. |
| SEO | Need extra modules (nuxt-i18n-router) or manual static generation. | CLI produces fully indexed HTML for each locale out of the box. |
| Self‑hosted security | Translation files are static, but you still need a translation service. | You keep the LLM API key on your server; no third‑party translation service stores your content. |
| Framework agnostic | Nuxt‑specific plugin. | Works with React, Vue, WordPress, Shopify, plain HTML – same config. |
For a marketing site that must launch in multiple markets overnight, the speed and SEO guarantees of SiteLocaleAI are decisive.
5. Real‑World Numbers (Demo)
| Locale | Page size (KB) | Time to generate (CLI) |
|---|---|---|
| en | 45 | 0.8 s |
| fr | 46 | 0.9 s |
| de | 46 | 0.9 s |
| es | 45 | 0.8 s |
The CLI runs in parallel, so a 10‑page site is fully rendered in under 10 seconds.
6. Getting Started
- Create the config (
siteLocale.config.js). - Install the library (
npm i @sitelocaleai/js). - Add the Nuxt plugin (
plugins/siteLocale.client.ts). - Wrap translatable text with
<Locale>. - Run the SEO CLI (
npx siteLocaleai seo). - Deploy – your CDN serves the pre‑rendered HTML to bots, while users enjoy dynamic, price‑localized content.
For a deeper dive, check the official docs:
- https://sitelocaleai.com/docs/quick-start
- https://sitelocaleai.com/docs/seo-cli
7. Call to Action
Ready to launch your Nuxt.js site in 5+ languages overnight while keeping SEO and price psychology on point? Try SiteLocaleAI for free and see how a single config file can replace an entire i18n pipeline.