Advanced
Internationalization
Translate every UI string with one YAML file.
Every UI string in the theme — “Previous”, “Next”, “On this page”, “Search workshops…”, and 40 more — lives in i18n/en.yaml. Translate by adding a sibling file.
Adding a translation #
Drop a new file at i18n/<lang>.yaml in your site (or in the theme), copying i18n/en.yaml and translating each value:
# i18n/de.yaml — German
- id: home
translation: "Startseite"
- id: previous
translation: "Zurück"
- id: next
translation: "Weiter"
- id: onThisPage
translation: "Auf dieser Seite"
- id: searchPlaceholder
translation: "Workshops durchsuchen…"
# … etc.Then in your hugo.toml:
defaultContentLanguage = "de"Or for a multilingual site, configure both:
defaultContentLanguage = "en"
[languages]
[languages.en]
title = "Splunk Workshops"
weight = 1
[languages.de]
title = "Splunk Werkstätten"
weight = 2
languageName = "Deutsch"See Hugo’s multilingual docs for the content-side setup (per-language markdown files, language switching, etc.).
All translation keys #
The theme uses these keys. If you add a new key in your custom partial, add it to every language file you ship.
| Key | English |
|---|---|
home | Home |
workshops | Workshops |
previous | Previous |
next | Next |
allWorkshops | All workshops |
onThisPage | On this page |
skipToContent | Skip to content |
editOnGitHub | Edit this page on GitHub |
searchPlaceholder | Search workshops… |
searchHint | Press / to search |
searchEmpty | No matches |
lessonsCount | (plural) {{ .Count }} lesson(s) |
presenter | Presenter |
copyCode | Copy |
copied | Copied |
chapter | Chapter |
notFoundTitle | Not found. |
notFoundLead | The page you’re looking for slipped through… |
takeMeHome | Take me home |
browseWorkshops | Browse workshops |
viewOnGitHub | View on GitHub |
builtWithHugo | Built with Hugo |
theme | Theme |
openMenu | Open menu |
A few callout-related keys (tip, note, warning, etc.) exist but are mostly used as default titles — overriding them in a translation only matters if you also use the notice shortcode without an explicit title.
The full list lives in i18n/en.yaml.
Pluralization #
The lessonsCount key uses Hugo’s plural form:
- id: lessonsCount
translation:
one: "{{ .Count }} lesson"
other: "{{ .Count }} lessons"In templates:
{{ i18n "lessonsCount" (dict "Count" 5) }}
{{/* renders: "5 lessons" */}}Languages with more complex plural rules (Russian, Polish, Arabic) get additional CLDR forms (few, many, zero). Hugo handles them; the YAML structure just expands:
- id: lessonsCount
translation:
one: "{{ .Count }} урок"
few: "{{ .Count }} урока"
many: "{{ .Count }} уроков"
other: "{{ .Count }} уроков"RTL languages #
For right-to-left languages (Arabic, Hebrew):
- Create
i18n/ar.yaml. - In your site’s
hugo.toml, set[languages.ar] languagedirection = "rtl". - The theme doesn’t ship dedicated RTL CSS yet, but the layout flips reasonably under
dir="rtl". PR welcome if you want to polish RTL handling.
