Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: configure display of language names in languange switcher #707

Open
mayuxi opened this issue Aug 18, 2024 · 1 comment
Open

feature: configure display of language names in languange switcher #707

mayuxi opened this issue Aug 18, 2024 · 1 comment
Assignees
Milestone

Comments

@mayuxi
Copy link

mayuxi commented Aug 18, 2024

Hi!

A little suggestion. Now Ananke uses {{ .Lang }} as language link in layouts/partials/i18nlist.html, which makes language switcher links like that:

en pt-BR he ru

I suggest using .Site.Language.LanguageName instead, so the user can customize the language names in his config file. For example, it could be full names (English, Português, Русский), or even flag emojis (🇬🇧 🇧🇷 🇷🇺).

Sorry, I'm new to Hugo and Ananke, here is my suggested code for layouts/partials/i18nlist.html:

before

<a class="hover-white no-underline white-90" href="{{ .RelPermalink }}">{{ .Lang }}</a>

after

<a class="hover-white no-underline white-90" href="{{ .RelPermalink }}">{{ .Site.Language.LanguageName | default .Lang }}</a>

@davidsneighbour
Copy link
Collaborator

I agree; this should be a configuration option. For the time being, you can override the theme file by adding a copy to your own repository under layouts/partials/i18nlist.html and adding your changes there.

@davidsneighbour davidsneighbour changed the title Using Language names instead of language keys in languange switcher feature: configure display of language names in languange switcher Sep 19, 2024
@davidsneighbour davidsneighbour added this to the unplanned milestone Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants