Open milotype opened 6 months ago
Implementation idea:
Could use
var lang = navigator.language || navigator.userLanguage;
and then compare with <html lang="en">
.
For example if de
is detected, check if there is a <link rel="alternate" hreflang="de" href="https://www.kimai.org/de/">
and redirect there.
If not existing, check if one of the users fallback languages is existing and redirect.
If redirect happens, set a session cookie. If a language is chosen manually in the dropdown, set the session cookie as well.
ONLY execute the above logic on https://www.kimai.org Do NOT redirect if cookie is existing, to prevent redirect-loops.
Feature request: Implement automatic language detection for the website Kimai - Open Source time-tracker according to the language setting of the user's browser or the user's system language setting.
If you don't want that, I'd suggest to place the language dropdown menu into the navigation bar at the top of the webpage instead of at the footer of the webpage.