mirror of https://github.com/theNewDynamic/gohugo-theme-ananke.git

Patrick Kollitsch
13 hours ago 8269245c6edc93bd6ca9564cf0a12f93714d6a15
refs
author Patrick Kollitsch <davidsneighbourdev+gh@gmail.com>
Saturday, November 21, 2026 09:15 +0100
committer Patrick Kollitsch <davidsneighbourdev+gh@gmail.com>
Saturday, November 21, 2026 09:15 +0100
commit8269245c6edc93bd6ca9564cf0a12f93714d6a15
tree 391794171b60f998c81be3a6784beb89774eb985 tree | zip | gz
parent 039de0cc607a6558ed8dd37bfdb884066ff54305 view | diff
feat(i18n): show language labels in the language switcher

The switcher showed language keys such as `en` or `pt-br`. Show the
`label` of each language from the site configuration instead, and fall
back to the key when no label is set. Add `lang` and `hreflang` with
the language locale, so assistive technology reads each name in its
own language.

Closes #707

Signed-off-by: Patrick Kollitsch <davidsneighbourdev+gh@gmail.com>
1 files modified
5 files added
62 ■■■■■ changed files
layouts/_partials/i18nlist.html 4 ●●●●● diff | view | raw | blame | history
tests/fixtures/language-switcher/content/page.de.md 5 ●●●●● diff | view | raw | blame | history
tests/fixtures/language-switcher/content/page.en.md 5 ●●●●● diff | view | raw | blame | history
tests/fixtures/language-switcher/content/page.fr.md 5 ●●●●● diff | view | raw | blame | history
tests/fixtures/language-switcher/hugo.toml 17 ●●●●● diff | view | raw | blame | history
tests/fixtures/language-switcher/language-switcher.test.mjs 26 ●●●●● diff | view | raw | blame | history