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:

yaml
# 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:

toml
defaultContentLanguage = "de"

Or for a multilingual site, configure both:

toml
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.

KeyEnglish
homeHome
workshopsWorkshops
previousPrevious
nextNext
allWorkshopsAll workshops
onThisPageOn this page
skipToContentSkip to content
editOnGitHubEdit this page on GitHub
searchPlaceholderSearch workshops…
searchHintPress / to search
searchEmptyNo matches
lessonsCount(plural) {{ .Count }} lesson(s)
presenterPresenter
copyCodeCopy
copiedCopied
chapterChapter
notFoundTitleNot found.
notFoundLeadThe page you’re looking for slipped through…
takeMeHomeTake me home
browseWorkshopsBrowse workshops
viewOnGitHubView on GitHub
builtWithHugoBuilt with Hugo
themeTheme
openMenuOpen 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:

yaml
- id: lessonsCount
  translation:
    one:   "{{ .Count }} lesson"
    other: "{{ .Count }} lessons"

In templates:

go-html-template
{{ 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:

yaml
- id: lessonsCount
  translation:
    one:   "{{ .Count }} урок"
    few:   "{{ .Count }} урока"
    many:  "{{ .Count }} уроков"
    other: "{{ .Count }} уроков"

RTL languages #

For right-to-left languages (Arabic, Hebrew):

  1. Create i18n/ar.yaml.
  2. In your site’s hugo.toml, set [languages.ar] languagedirection = "rtl".
  3. 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.
Last Modified ·