-
Notifications
You must be signed in to change notification settings - Fork 667
Expand file tree
/
Copy pathindex.html
More file actions
44 lines (41 loc) · 1.32 KB
/
index.html
File metadata and controls
44 lines (41 loc) · 1.32 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Ruby Programming Language</title>
<script type="text/javascript">
var languages = {
"de": "de",
"es": "es",
"id": "id",
"ja": "ja",
"ko": "ko",
"pt": "pt",
"ru": "ru",
"tr": "tr",
"uk": "uk",
"zh-CN": "zh_cn",
"zh-TW": "zh_tw"
};
var code = window.navigator.language || window.navigator.userLanguage || "en";
if (code.substr(0,2) !== "zh") { code = code.substr(0,2); }
var language = languages[code];
if (!language) { language = "en"; }
// If we're running on localhost/loopback for local development,
// keep redirects relative so the developer can test locally.
var host = window.location.hostname;
var isLocal = (host === 'localhost' || host === '127.0.0.1' || host === '::1');
if (isLocal) {
document.location = "/" + language + "/";
} else {
document.location = "https://www.ruby-lang.org/" + language + "/";
}
</script>
<noscript>
<meta http-equiv="refresh" content="0; url=https://www.ruby-lang.org/en/">
</noscript>
</head>
<body>
<p><a href="https://www.ruby-lang.org/en/">Click here</a> to be redirected.</p>
</body>
</html>