Multi-language website redirection util that helps to determine redirection URL for the multilanguage websites.
lang-redirect is using <link rel="alternate" href="..." hreflang="...">
and
navigator.languages
to suggest a redirection link.
Consider HTML page below:
<html lang="en">
<head>
...
<link rel="alternate" href="https://cmints.io/ru/" hreflang="ru">
<link rel="alternate" href="https://cmints.io/de/" hreflang="de">
<link rel="alternate" href="https://cmints.io/es/" hreflang="es">
...
</head>
...
</html>
const {suggestRedirect} = require("lang-redirect");
suggestRedirect(); // ex. output: https://cmints.io/ru/
Learn more about functions here.