Advanced
/ No. ⁨3⁩
Article internationalization
2022-11-30

Every zine website has a default locale which is specified by the locale field in the [site] section of root zine.toml.

[site]
# the locale to localize your Zine site. default to "en".
# Zine has builtin supported locales, please check the `locales` directory of zine's repo.
locale = "en"

If you need to add a translation version for an article, you can simply add i18n.locale to your [[article]] section, see below:

[[article]]
file = "1-first.md"
title = "First article"
# the translations of this artcle.
# the key of syntax is `i18n.[locale]`, the value is the article object.
i18n.fr = { file = "1-first-fr.md", title = "Premier article", pub_date = "2022-11-27" }
i18n.zh = { file = "1-first-zh.md", title = "第一篇文章", pub_date = "2022-11-27" }

Zine will render different translation articles and show a translation menu to switch between those articles.