Could someone share a concrete example of the best use of the multilingual site creation official documentation?
It’s not very clear… Furthermore, in my case, I’m using TOML writing and it’s completely different of explained in the doc.
Could someone share a concrete example of the best use of the multilingual site creation official documentation?
It’s not very clear… Furthermore, in my case, I’m using TOML writing and it’s completely different of explained in the doc.
The second example in the link you gave is a sample toml configuration file (also includes Blackfriday
configuration)
Add dots into toml
configuration to emulate nested behaviour from yaml
[Languages.en.params]
The link to Translated Content
which you have given is useful for displaying word count
in different languages with the help of the snippet
{{ i18n "wordCount" . }}
I also have found it very difficult to understand. Maybe it’s a good idea to explicitly mention this in documentation.
I’m using hugo-agency-theme which has a lot of content defined in config.toml Hence, there are variables in config.toml which need to be translated.
That what I have proven to work for my config.toml
[languages]
[languages.en]
languageCode = "en-us"
weight = 1
[languages.en.services]
enable = true
title = "Services"
subtitle = ""
[languages.ru]
weight = 2
languageCode = "ru-ru"
[languages.ru.services]
title = "Сервисы"
subtitle = ""
enable = true
In templates these values are available as .Site.Params.services for current language.
Here is example of partial which uses this config.
My guess was that one have to define the section in question as languages.en.params.services, because by default it’s params.servercies, but no, it works as described above.