Add a second language
Turn a single-language site into a multilingual one, step by step.
This guide adds German to an English site. It works the same for any language.
-
Add the language in
settings/config.php. The first language stays the default language and keeps its addresses without a prefix.'languages' => [ 'en' => 'English', 'de' => 'Deutsch', ], -
Translate the site title. Copy
content/website.mdtocontent/website.de.mdand translate it. -
Translate entries one by one. Next to
content.md, createcontent.de.mdand give it its ownslug:--- title: Über uns slug: ueber-uns --- Wir sind …The page is now available at
/de/ueber-uns. Images in the folder are shared, you don't copy them. -
Decide what happens with untranslated entries. By default they don't exist in German (404). If you prefer to show the English version with a notice, set:
'missing_translation' => 'fallback', -
Add a language switcher to your theme, if it doesn't have one. Tide shows one automatically. In your own theme:
@foreach ($site->languages() as $code => $name) @if ($entry?->translation($code)?->isPublished()) <a href="{{ $entry->translation($code)->url() }}" hreflang="{{ $code }}">{{ $name }}</a> @endif @endforeach
Wake takes care of the rest: hreflang links in the head, one RSS feed per
language (/de/feed.xml) and alternates in sitemap.xml.
Related
source: docs/guides/second-language.md