-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathexamle.html
47 lines (39 loc) · 1.45 KB
/
examle.html
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
45
46
47
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>internationalisation demo</title>
</head>
<body>
This is an example template, which should show how different frameworks do internationalisation (i18n) with javascript. Please feel free to implement your javascript i18n framework, to show how your framework work.
<h1 id="title">This title should be set by javascrpt</h1>
<p id="text">This text should be set by javascript</p>
<hr />
<from>
<p id="instruction1">Should be set by js</p><input id="num" type="text" size="5" maxlength="5" value="2" />
<p id="instruction2">Should be set by js</p><select id="lang" size="1">
<option value="de">German</option>
<option value="en">English</option>
</select>
</form>
<script type="text/javascript">
var text = document.getElementById("text").firstChild,
title = document.getElementById("title").firstChild,
instruction1 = document.getElementById("instruction1").firstChild,
instruction2 = document.getElementById("instruction2").firstChild,
num = document.getElementById("num"),
lang = document.getElementById("lang");
title.nodeValue = "This is the tile of the i18n test example";
text.nodeValue = "You have 2 balls";
instruction1.nodeValue = "Change number of balls:";
instruction2.nodeValue = "Choose language";
num.onchange = function (e) {
var t = "You have "+num.value+" balls.";
if (num.value < 2) {
t="You have "+num+" ball.";
}
text.nodeValue=t;
}
</script>
</body>
</html>