-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
28 lines (26 loc) · 1.14 KB
/
index.html
File metadata and controls
28 lines (26 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<!DOCTYPE html>
<html lang="en">
<head>
<meta content="Home of DataLab, the open-source platform for scientific and technical data processing and visualization" name="description" />
<meta content="DataLab, scientific, data, processing, visualization, open-source, platform, Python, Qt, NumPy, SciPy, scikit-image, OpenCV, PlotPyStack, Codra, Pierre Raybaut" name="keywords" />
<title>Language Redirect</title>
<script type="text/javascript">
function redirectBasedOnLanguage() {
var userLang = navigator.language || navigator.userLanguage;
var baseURL = window.location.origin + window.location.pathname;
// Ensure the base URL does not end with a slash
if (baseURL.endsWith('/')) {
baseURL = baseURL.slice(0, -1);
}
if (userLang.includes("fr")) {
window.location.href = baseURL + "/fr/";
} else {
// Default to English if French is not detected
window.location.href = baseURL + "/en/";
}
}
</script>
</head>
<body onload="redirectBasedOnLanguage()">
</body>
</html>