Languages

This theme is translatable. So you can change the default language from the config/_default/config.toml file. We provided two languages, English and French. But you can add as many languages as you want.

For maintaining languages, you need to open the config/_defaults/languages.toml file and follow the steps below.

For maintaining it from forestry, you can find it at the bottom of the left sidebar. The file called Languages

  1. Language is a loop item. So you can duplicate it as many times as you want. Then change the name of the language. See Official Docs for more information.
  2. languageName is the name of the language.
  3. languageCode is the code of the language. You can get your language code from the ISO 639-1 or ISO 639-2 codes.
  4. contentDir is the directory where the content of the language is stored. For example, if you want to create a Spanish language, you need to create a directory called content/spanish.
  5. weight is the weight of the language. Smaller weight will be the first language.

Example Code

######## English language ##########
[en]
languageName = "En"
languageCode = "en-us"
contentDir = "content/english"
weight = 1

######## French language ##########
[fr]
languageName = "Fr"
languageCode = "fr-fr"
contentDir = "content/french"
weight = 2
Improve this page on Github  — Last updated:  Sat, Oct 2, 2021