-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
26 lines (23 loc) · 811 Bytes
/
index.html
File metadata and controls
26 lines (23 loc) · 811 Bytes
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="0;url=index_zh-CN.html">
<meta name="msvalidate.01" content="1727F0C7E3C4ED3F2E998816FF722686" />
<title>Redirecting...</title>
</head>
<body>
<p>If you are not redirected, <a href="index_zh-CN.html">click here</a>.</p>
<script>
// Get the user's preferred language from the browser
const userLang = navigator.language || navigator.userLanguage;
// Define the available languages
const availableLanguages = ['zh-CN', 'en'];
// Check if the user's language is in the available languages
if (availableLanguages.includes(userLang)) {
// Redirect to the corresponding language page
window.location.href = `index_${userLang}.html`;
}
</script>
</body>
</html>