Feature suggestion: automatically redirect user to last selected language
See original GitHub issue- I’ve read the contribution guidelines and agree with them
I want to suggest an idea and checked that …
- … to my best knowledge, my idea wouldn’t break something for other users
- … the documentation does not mention anything about my idea
- … there are no open or closed issues that are related to my idea
Description
When using the alternate
feature, it would be nice if the selected language was saved in local storage.
Use Cases
Build features on top of being able to tell which language a user selected.
Screenshots / Mockups
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Best practices for language redirection - Weglot
A much less tedious and user-friendly option is to automatically redirect to alternative languages. And so, this is what we'll be focusing on ......
Read more >how to automatically redirect the user to a specific language in ...
1 Answer 1 · Don't change anything. Django's locale middleware is quite good at discovering language preferences and redirects users to their ...
Read more >Automatic User Language Detection in TranslatePress
Automatic User Language Detection in TranslatePress ... Redirecting visitors to their own language preference based on browser language or IP ...
Read more >REDIRECT USER BY LAST SELECTED LANGUAGE - WPML
I have a website with 2 languages namely PT (as default language) and EN is it possible for me to redirect users based...
Read more >Smart Language Redirects Or How To Quickly Autotranslate Shopify ...
With this request the system receives the browser language and IP address data, which is detected with auto detection mode. And based on...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Okay, so we could persist the
hreflang
value when switching languages:https://github.com/squidfunk/mkdocs-material/blob/a4a00af0177e4d50e0af47ae2edb2723b4c50c28/src/partials/header.html#L118
That could actually work. However, it would only be sensical when the language-based routing (aka “Stay on page when switching languages”) is implemented. Then, we could detect the last-selected language and route the user automatically to the respective page, given that the pages have the same file name (= URL) in both languages. Otherwise, it would fall back to the homepage.
This issue has currently zero interest in the community, which is why I’m not considering it for implementation. The desired behavior can be achieved via theme extension and some additional JavaScript.