Looking for help understanding translations

I’m trying to build a multi-lingual website and am having some trouble getting it to work.

This is my config.toml

default_language = "en"

[languages.en.translations]
home_title = "My Website"
home_desc = "Welcome to my website"

[languages.fr.translations]
home_title = "Mon site internet"
home_desc = "Bienvenue sur mon site"

And this is my index.html

<h1>{{ trans(key="home_title") }}</h1>
<p>{{ trans(key="home_desc") }} </p>

Zola generates both an index.html and /fr/index.html, however, both generated pages contain english text. It seems to me that Zola is not picking up my [languages.fr.translations] section. Any suggestions?

You need to pass a lang attribute, otherwise it defaults to the default one. Do {{ trans(key="home_desc", lang=lang) }} and that should work