> Documentation index: [llms.txt](https://www.i18next.com/llms.txt). Every page is also available as Markdown at its URL plus `.md`.

[With your agent](https://www.i18next.com/with-your-agent) / New site

# Build a multilingual website with your agent

“I need a website for my bakery in English and German, and I want my agent to build it.”

For the owner who builds their own site, a bakery or a practice, and for the one-person agency that builds a site for each client with an agent and looks after it afterwards.

Prompt Replace the parts in brackets, then paste it into your agent

```
Build a website for [my bakery, Example Bakery]
in [English and German], [English] as the default language,
with Astro and i18next (v27).

Use plain i18next at build time, no extra integration package:
- one page file per page under src/pages/[lang]/,
  with getStaticPaths for each language
- the texts in src/locales/<lang>/common.json, string keys with t('key')
- plurals with the _one and _other suffixes and count
- a language switcher, <html lang>, and hreflang links
  between the language versions of each page
- i18next-cli with i18next-cli-plugin-astro, and
  "build": "i18next-cli status && astro build"
  so a missing translation stops the build
At the end, list the translation files so I can check the texts.
```

Building with Next instead? The way for Next, with its prompt, is [below](#next). This page as Markdown for your agent: [build-multilingual-site.md](https://www.i18next.com/with-your-agent/build-multilingual-site.md)

## What your agent builds

Both ways use the same translation files and the same `t('key')` call, so the texts move with you if you change the framework later.

### Astro Static site

A site that is built once and served as plain HTML. i18next runs while the site is built.

1. One page file serves every language: `src/pages/[lang]/index.astro` → `/en/`, `/de/`.
2. Each language page creates its own i18next instance with that language.
3. The texts sit in one JSON file per language.

src/pages/\[lang]/index.astro

```
---
import i18next from 'i18next'
import en from '../../locales/en/common.json'
import de from '../../locales/de/common.json'

export function getStaticPaths() {
  return [{ params: { lang: 'en' } }, { params: { lang: 'de' } }]
}
const i18n = i18next.createInstance()
await i18n.init({ lng: Astro.params.lang,
  defaultNS: 'common', resources: { en: { common: en }, de: { common: de } } })
const t = i18n.t
---
<h1>{t('hero.title')}</h1>
<p>{t('loaves', { count: 3 })}</p>
```

In a test on 2026-11-19 (Astro 7.4.13, i18next 27.2.2) the build wrote one HTML file per language and page, with no JavaScript file and no script tag. Server rendering and interactive islands were not part of that test.

### Alternative with Next App Router

A site with a server, for example with forms, a login or a shop. `next-i18next` v16 puts the language in the path and loads the texts on the server.

1. The language is the first part of every address: `/en/about`, `/de/about`.
2. Server Components read texts with `await getT()`, Client Components with `useT()`.
3. The texts sit in one JSON file per language and namespace.

Prompt for Next

```
Build a website for [my bakery, Example Bakery] in [English and German], [English] as the default language, with Next.js (App Router), next-i18next (v16) and i18next (v27). Put the language in the path (/en, /de), use await getT() in Server Components and useT() in Client Components, string keys with t('key'), and add hreflang links between the language versions. At the end, list the translation files so I can check the texts.
```

[App Router setup, step by step](https://www.i18next.com/next/app-router/setup)

## When the client changes the texts later

Your texts are JSON files in the repository. When the client wants a change, there are two ways.

### The client sends the change

You or your agent edit the file and deploy. It costs nothing extra and fits when changes are rare and you want to look at each one.

### The client edits the texts in Locize

The client changes the texts in a web editor, in every language, without you in between. A webhook can start a new build of the site when texts change or a version is published, so the site shows what the client changed. It pays off when the client wants to change texts often or on their own schedule, and when you look after many client sites.

From the maintainers Locize is the translation management service of the people who maintain i18next; its customers fund i18next.

[Locize for your team](https://www.locize.com/for-your-team)

## Before the site goes live

- Have each language read by someone who speaks it. An agent's translation is a first draft.
- Open a page in each language and switch between them: the address, the `<html lang>` and the texts change together.
- Decide who changes the texts later, and how. That is the section above.
