Skip to content
Patchwork
Start free
All docs pages

Docs · Make it yours

Languages

One language per site, in English, Spanish, French or Dutch, and how to add another.

A site has one language: language in src/config/aurora.config.mjs, 'en', 'es', 'fr' or 'nl'. It sets the menus, the buttons, the forms, the dates and <html lang>.

The words

Every word the theme shows is in src/i18n/translations/<language>.ts: en.ts, es.ts, fr.ts and nl.ts. The menus, the buttons and the copy of every page are there, so you change the copy there and not in the components. See Pages and words.

When you add a word to one file, add it to all four. A key missing from English shows on the page as the key itself, and pnpm check:agent reports it.

Posts and projects

Posts are read from src/content/blog/<language>/ and projects from src/content/projects/<language>/. The demo’s posts and projects are in English only, so a site in another language starts with an empty blog and portfolio.

These docs and the components page are in English in every language: they’re about the theme, for the person who builds the site.

Addresses

Some pages get a translated address, such as /precios for the Spanish pricing page. The slugs are in routes in src/config/nav.config.ts.

A fifth language

A fifth language needs:

  1. A translations file with every key of en.ts. Velocity’s own strings (the ones in src/i18n/ui.ts) are translated only for English, Spanish and French, so add those to the new file as well, as nl.ts does.
  2. Its slugs in nav.config.ts.
  3. The language in the type of language in aurora.config.mjs, and in the locale lists in src/content.config.ts and src/config/collections.ts.

Several languages at once

The theme runs one language per site. Velocity, which it’s built on, can run several with translated addresses and a language switcher: replace the two lines in src/i18n/locales.mjs with a list such as ['en', 'nl'] and a default. Aurora’s pages and settings are made for one language, so check every page after that change.