Skip to content

Changing the language

Warning

This page is work in progress.

CoRA supports internationalization (i18n) and provides translations for template variables and labels in many languages.

Configuration

Site language

  1. HTML5 only allows to set a single language per document, which is why CoRA only supports setting a canonical language for the entire project.

    The easiest way to build a multi-language documentation is to create one project in a subfolder per language, and then use the language selector to interlink those projects.

The following languages are supported:

Translations missing? Help us out, it takes only 5 minutes

CoRA relies on outside contributions for adding and updating translations for the more than 60 languages it supports. If your language shows that some translations are missing, click on the link to add them. If your language is not in the list, click here to add a new language.

Site language selector

If your documentation is available in multiple languages, a language selector pointing to those languages can be added to the header. Alternate languages can be defined via mkdocs.yml.

extra:
  alternate:
    - name: English
      link: /en/ # (1)!
      lang: en
    - name: Deutsch
      link: /de/
      lang: de
  1. Note that this must be an absolute link. If it includes a domain part, it's used as defined. Otherwise the domain part of the site_url as set in mkdocs.yml is prepended to the link.

The following properties are available for each alternate language:

This value of this property is used inside the language selector as the name of the language and must be set to a non-empty string.

This property must be set to an absolute link, which might also point to another domain or subdomain not necessarily generated with MkDocs.

This property must contain an ISO 639-1 language code and is used for the hreflang attribute of the link, improving discoverability via search engines.

Directionality

While many languages are read ltr (left-to-right), CoRA also supports rtl (right-to-left) directionality which is deduced from the selected language, but can also be set with:

theme:
  direction: ltr

Click on a tile to change the directionality:


Last update: 2024-01-05
Created: 2024-01-05