Skip to content

Commit

Permalink
update readme with explanations on how to modify or add a language
Browse files Browse the repository at this point in the history
  • Loading branch information
Olivier Keul committed Feb 14, 2024
1 parent ba99f86 commit 16be7b2
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,35 @@ Please do not add links in the endorsement section. This isn't an exercise in SE

Please use the PR process described below, issuing your PR against the `develop` branch.

### Edit content in an existing language or add a new language

If you want to modify an existing language, simply go to the corresponding file in the `i18n/` folder, e.g. `i18n/en.yml` (for english) and modify the contents. If a translation key doesn't exist, it automatically switches to english content.

If you want to add a new language, it's only a 2-step process:
1. In the `hugo.toml` file, add the new language, e.g. spanish in third position
```
[languages]
[languages.en]
contentDir = 'i18n/en'
weight = 1
[languages.en.params]
languageName = 'english'
languageNameShort = 'en'
[languages.fr]
contentDir = 'i18n/fr'
weight = 2
[languages.fr.params]
languageName = 'français'
languageNameShort = 'fr'
[languages.es]
contentDir = 'i18n/es'
weight = 3
[languages.fr.params]
languageName = 'español'
languageNameShort = 'es'
```
2. In the `i18n/` folder, add a yml file with the language shortname, e.g. `i18n/es.yml` (if spanish), and translate each key in this file.

### Design and/or Code

Contributions to the design and/ or code are encouraged!
Expand Down

0 comments on commit 16be7b2

Please sign in to comment.