These are the configurations governing the multilingual mode specific settings. They are the things like setting language code, language name, language specific content directory, title, and the language priority weight. We will go through them in detailed.
[en-us]
languageCode = "en-us"
languageName = "English"
contentDir = "../docs/en-us"
title = "My New Hugo Site"
weight = 0
[zh-cn]
languageCode = "zh-cn"
languageName = "Chinese (Simplified)"
contentDir = "../docs/zh-cn"
title = "我的Hugo网站"
weight = 1
The filename should be something like config/<ENV>/languages.toml
.
All language's main tag is an array element. Hence, notice the example above, we have the:
[en-us]
...
[zh-cn]
...
tags for each languages settings. Notice the [ ... ]
bracket. These are TOML (when you're writing in TOML) array elements. You can declare any language code symbol as you want thanks to Hugo's new upgrades.
However, although such freedom is granted, I would strong advised to stick back with RFC5646 standard. That also means you would maintain somethings like:
en-us
en-my
en-uk
zh-cn
zh-tw
...
Defining the language code for the chosen language. Keep in mind that this is not fully used across all systems. It's merely a variable holding that label. This value should be the same value as the data tag.
Defining the full name of the language.
The content of the language specific content directory.
The language specific title.
The language priority for language arrangement such as language drop-down menu.
That's all about language specific settings.