-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
feat: new language switch behaviour #1159
base: master
Are you sure you want to change the base?
feat: new language switch behaviour #1159
Conversation
…weight but linking to translations if available feat: if language switch shows language codes (instead of full language name), those codes are now uppercase feat: translation list in post headers are replaced by links to translations in page headers - the old translation list in the post header can still be enabled using the boolean parameter "showTranslationListInPosts" (i.e. to turn it back on, add the parameter to your hugo.toml and set it to true)
Kudos, SonarCloud Quality Gate passed!
|
Hi @HarisDotParis there is a reason that the language switch always links to each language's main page and not any possible translation of the page. For the case where the particular page has a translated page listed, we have the translations, mentioned right under the title of the page |
I am sorry, but I consider this deviating from the regular behaviour of language switches. Most multilingual websites forward to the translation if possible, and only to the main page if no translation is available. This also makes sense, because most users switching languages want to read the same content in either their own or the original language. Regularity only for the sake of it doesn't make sense. Always forwarding to the main page may create regularity, but it makes a simple feature more complex, and this makes the UX worse. |
I think the site would have greater regularity if there was only one switch (in the nav bar) and not two (nav bar + posts meta), but then the switch in nav bar should translate the page and not go to home. That said, it's not a big deal, just my 2 cents. Awesome theme btw! 😄 |
Kudos, SonarCloud Quality Gate passed!
|
bcd75b6
to
55b2eb4
Compare
Any updates on this? Would love this feature. Having two translation buttons is very confusing. |
What does this PR change? What problem does it solve?
Currently, the language switch always links to each language's main page and not any possible translation of the page. This PR changes the way the language switch works significantly. The language switch still lists all languages available according to their "weight", but if there is a translation, then that translation will be linked, otherwise that language's main page as before. As this replaces the need for the translation list in posts, translation lists in posts have been made optional with a new boolean parameter "showTranslationListInPosts". I have tested the changes extensively and with different parameters and language settings.
Was the change discussed in an issue or in the Discussions before?
Closes #1065
PR Checklist