Skip to content

Language

With the help of contributors, templates are localized into more than 60 languages, making it easy to create documentation sites in your preferred language.

Configuration

Site language

You can set the site language in your configuration file with:

[project.theme]
language = "en"
theme:
  language: en

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

The following languages are supported:

  1. ๐Ÿ‡ฟ๐Ÿ‡ฆ Afrikaans af Complete
  2. ๐Ÿ‡ฆ๐Ÿ‡ฑ Albanian sq Complete
  3. ๐Ÿ‡ฆ๐Ÿ‡ช Arabic ar Complete
  4. ๐Ÿ‡ฆ๐Ÿ‡ฒ Armenian hy Complete
  5. ๐Ÿ‡ฆ๐Ÿ‡ฟ Azerbaijani az Complete
  6. ๐Ÿ‡ฒ๐Ÿ‡พ Bahasa Malaysia ms Complete
  7. ๐Ÿ‡ช๐Ÿ‡ธ Basque eu Complete
  8. ๐Ÿ‡ง๐Ÿ‡พ Belarusian be Complete
  9. ๐Ÿ‡ง๐Ÿ‡ฉ Bengali (Bangla) bn Complete
  10. ๐Ÿ‡ง๐Ÿ‡ฌ Bulgarian bg Complete
  11. ๐Ÿ‡ช๐Ÿ‡ธ Catalan ca Complete
  12. ๐Ÿ‡จ๐Ÿ‡ณ Chinese (Simplified) zh Complete
  13. ๐Ÿ‡น๐Ÿ‡ผ Chinese (Taiwanese) zh-TW Complete
  14. ๐Ÿ‡จ๐Ÿ‡ณ Chinese (Traditional) zh-Hant Complete
  15. ๐Ÿ‡ญ๐Ÿ‡ท Croatian hr Complete
  16. ๐Ÿ‡จ๐Ÿ‡ฟ Czech cs Complete
  17. ๐Ÿ‡ฉ๐Ÿ‡ฐ Danish da Complete
  18. ๐Ÿ‡ณ๐Ÿ‡ฑ Dutch nl Complete
  19. ๐Ÿ‡บ๐Ÿ‡ธ English en Complete
  20. ๐Ÿ‡ช๐Ÿ‡บ Esperanto eo Complete
  21. ๐Ÿ‡ช๐Ÿ‡ช Estonian et Complete
  22. ๐Ÿ‡ซ๐Ÿ‡ฎ Finnish fi Complete
  23. ๐Ÿ‡ซ๐Ÿ‡ท French fr Complete
  24. ๐Ÿ‡ช๐Ÿ‡ธ Galician gl Complete
  25. ๐Ÿ‡ฉ๐Ÿ‡ช German de Complete
  26. ๐Ÿ‡ฌ๐Ÿ‡ท Greek el Complete
  27. ๐Ÿ‡ฎ๐Ÿ‡ฑ Hebrew he Complete
  28. ๐Ÿ‡ฎ๐Ÿ‡ณ Hindi hi Complete
  29. ๐Ÿ‡ญ๐Ÿ‡บ Hungarian hu Complete
  30. ๐Ÿ‡ฎ๐Ÿ‡ธ Icelandic is Complete
  31. ๐Ÿ‡ฎ๐Ÿ‡ฉ Indonesian id Complete
  32. ๐Ÿ‡ฎ๐Ÿ‡น Italian it Complete
  33. ๐Ÿ‡ฏ๐Ÿ‡ต Japanese ja Complete
  34. ๐Ÿ‡ฎ๐Ÿ‡ณ Kannada kn Complete
  35. ๐Ÿ‡ฐ๐Ÿ‡ท Korean ko Complete
  36. ๐Ÿ‡ฎ๐Ÿ‡ถ Kurdish (Soranรฎ) ku-IQ 13 translations missing
  37. ๐Ÿ‡ฑ๐Ÿ‡ป Latvian lv Complete
  38. ๐Ÿ‡ฑ๐Ÿ‡น Lithuanian lt Complete
  39. ๐Ÿ‡ฑ๐Ÿ‡บ Luxembourgish lb Complete
  40. ๐Ÿ‡ฒ๐Ÿ‡ฐ Macedonian mk Complete
  41. ๐Ÿ‡ฒ๐Ÿ‡ณ Mongolian mn Complete
  42. ๐Ÿ‡ณ๐Ÿ‡ด Norwegian Bokmรฅl nb Complete
  43. ๐Ÿ‡ณ๐Ÿ‡ด Norwegian Nynorsk nn Complete
  44. ๐Ÿ‡ฎ๐Ÿ‡ท Persian (Farsi) fa Complete
  45. ๐Ÿ‡ต๐Ÿ‡ฑ Polish pl Complete
  46. ๐Ÿ‡ต๐Ÿ‡น Portuguese pt Complete
  47. ๐Ÿ‡ง๐Ÿ‡ท Portuguese (Brasilian) pt-BR Complete
  48. ๐Ÿ‡ท๐Ÿ‡ด Romanian ro Complete
  49. ๐Ÿ‡ท๐Ÿ‡บ Russian ru Complete
  50. ๐Ÿ‡ฎ๐Ÿ‡ณ Sanskrit sa Complete
  51. ๐Ÿ‡ท๐Ÿ‡ธ Serbian sr Complete
  52. ๐Ÿ‡ท๐Ÿ‡ธ Serbo-Croatian sh Complete
  53. ๐Ÿ‡ธ๐Ÿ‡ฐ Slovak sk Complete
  54. ๐Ÿ‡ธ๐Ÿ‡ฎ Slovenian sl Complete
  55. ๐Ÿ‡ช๐Ÿ‡ธ Spanish es Complete
  56. ๐Ÿ‡ธ๐Ÿ‡ช Swedish sv Complete
  57. ๐Ÿ‡ฎ๐Ÿ‡ณ Tamil ta Complete
  58. ๐Ÿ‡ฎ๐Ÿ‡ณ Telugu te Complete
  59. ๐Ÿ‡น๐Ÿ‡ญ Thai th Complete
  60. ๐Ÿ‡น๐Ÿ‡ท Turkish tr Complete
  61. ๐Ÿ‡บ๐Ÿ‡ฆ Ukrainian uk Complete
  62. ๐Ÿ‡ต๐Ÿ‡ฐ Urdu ur Complete
  63. ๐Ÿ‡บ๐Ÿ‡ฟ Uzbek uz Complete
  64. ๐Ÿ‡ป๐Ÿ‡ณ Vietnamese vi Complete
  65. ๐Ÿด๓ ง๓ ข๓ ท๓ ฌ๓ ณ๓ ฟ Welsh cy Complete

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 configuration:

[project.extra]
alternate = [
    { name = "English", link = "/en/", lang = "en" },
    { name = "Deutsch", link = "/de/", lang = "de" }
]
extra:
  alternate:
    - name: English
      link: /en/ # (1)!
      lang: en
    - name: Deutsch
      link: /de/
      lang: de

The following properties are required for each alternate language:

alternate.name

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.

alternate.link

This property must be set to an absolute link, which might also point to another domain or subdomain not necessarily generated with Zensical. If it includes a domain part, it's used as defined. Otherwise the domain part of the site_url as set in your configuration is prepended to the link.

alternate.lang

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), Zensical also supports rtl (right-to-left) directionality which is deduced from the selected language, but can also be set with:

[project.theme]
direction = "ltr"
theme:
  direction: ltr

Click on a tile to change the directionality:

Customization

Custom translations

If you want to customize some of the translations for a language, just follow the guide on theme extension and create a new partial in the overrides folder. Then, import the translations of the language as a fallback and only adjust the ones you want to override:

<!-- Import translations for language and fallback -->
{% import "partials/languages/de.html" as language %}
{% import "partials/languages/en.html" as fallback %} <!-- (1)! -->

<!-- Define custom translations -->
{% macro override(key) %}{{ {
  "source.file.date.created": "Erstellt am", <!-- (2)! -->
  "source.file.date.updated": "Aktualisiert am"
}[key] }}{% endmacro %}

<!-- Re-export translations -->
{% macro t(key) %}{{
  override(key) or language.t(key) or fallback.t(key)
}}{% endmacro %}
  1. Note that en must always be used as a fallback language, as it's the default theme language.

  2. Check the list of available languages, pick the translation you want to override for your language and add them here.

[project.theme]
language = "custom"
theme:
  language: custom