# Sites in several languages One site, every language you need.

> vagejs is a multilingual static site generator. One folder per language, lang and hreflang tags on every page, and a check that finds missing translations.

vagejs is a static site generator with multi-language sites built in. One site holds every language, each in its own folder, with the right language and `hreflang` tags on every page, and a check that lists the pages still waiting for a translation. It's been part of vagejs since version 0.10.

`npm create vagejs@latest my-site`

[Read the multi-language docs](https://vagejs.com/docs/multi-language/)[Follow the step-by-step guide](https://vagejs.com/guides/multilingual-static-site/)

## How it works

Your visitors don't all read the same language. Your English pages stay right where they are, French pages go in a `fr` folder, and German pages in `de`. Each page knows its language, and translations point to each other.

| You write | Visitors get |
| --- | --- |
| `src/pages/about.md` | `/about/`, in English |
| `src/pages/fr/about.md` | `/fr/about/`, the French version |
| `src/pages/de/ueber-uns.md` with `translationOf: /about/` | `/de/ueber-uns/`, the German version, with its own German address |

A page with the same file name in a language folder is its translation. Want an address in the visitor's own language? Add one line saying which page it translates. You list your languages once, in `vage.config.ts`:

TypeScript

```
export default defineConfig({
  site: "https://example.com",
  lang: "en",
  i18n: { locales: ["fr", "de"] },
});
```

## What you get

We handle the fiddly parts of a multilingual site, so you can focus on the words.

-   ### The right language on every page
    
    French pages say they're French, so screen readers pronounce them properly and search engines know who they're for.
    
-   ### hreflang tags, written for you
    
    Every version of a page links to the others. Google uses these links to show people the version in their own language.
    
-   ### A language switcher without bookkeeping
    
    Your layout gets the list of translations for the page it's showing, so a switcher always points to pages that exist.
    
-   ### A check for missing translations
    
    `npm run check` lists every page that has no version in one of your languages, and names the file to add. A wrong language tag, or a translation that points nowhere, stops the build.
    
-   ### Feeds per language
    
    A blog feed for `/fr/blog/` holds the French posts and says it's French.
    
-   ### Menus and lists per language
    
    Give each language its own menu, and list just one language's pages, such as the French blog posts, with `collection()`.
    
    See [in your layouts](https://vagejs.com/docs/multi-language/#in-your-layouts)
    

## Who multilingual sites in vagejs are for

-   ### Businesses with customers in several languages
    
    You serve people in two or three languages and want one site to look after, not three.
    
-   ### Products with docs in several languages
    
    You translate your docs a page at a time, and the check keeps track of what's left.
    
-   ### Anyone whose AI assistant translates
    
    The check shows your assistant exactly what's missing, and you review what it writes.
    

## What it doesn't do

We'd rather you know the limits up front.

-   vagejs doesn't translate pages for you. You, a translator or your AI assistant write each version.
-   It doesn't send visitors to a language based on their browser settings. A language switcher works more reliably on a static site.
-   `llms.txt` and the sitemap list every language together, not one file per language.

## More on multilingual sites with vagejs

Some other static site generators also have multilingual support built in, and some of it is older and covers more complex setups. See [how vagejs compares](https://vagejs.com/compare/).

-   Step by step: [build a multilingual static website](https://vagejs.com/guides/multilingual-static-site/)
-   Every option and check: [multi-language sites in the docs](https://vagejs.com/docs/multi-language/)
-   Other features: [all vagejs features](https://vagejs.com/features/)

## Questions about multi-language sites

### Do I have to translate every page?

No. A page without a translation simply exists in one language. If you only translate some pages, list them under `i18n.pages` in `vage.config.ts` (vagejs 0.15.1 and newer), and `vage check` asks for translations of those pages only.

### Will a missing translation stop my site from building?

No. A missing translation is a warning, so the site still builds while you translate. Run `vage check --strict` if you want warnings to fail too. Real mistakes, such as a wrong language tag or a `translationOf` that points to a page that doesn't exist, are errors.

### Which language codes can I use?

Standard language codes such as `fr`, `de` or `pt-BR`. Your main language goes in `lang`, and the others go in `i18n.locales`. Don't list your main language twice.

### Can I add languages to a site I already have?

Yes. Your main-language pages keep their addresses, so nothing you've published moves. Add the new languages to `vage.config.ts` and put each translation in its language's folder.
