-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
executable file
·113 lines (94 loc) · 4.05 KB
/
index.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Translator by derzunov</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
</head>
<body>
<div class="container">
<div class="row">
<h1>Translator</h1>
<section class="col-md-6">
<h3>Russian section</h3>
<div class="form-inline">
<span>Number:</span>
<input id="ru-number" value="3" type="text" class="form-control">
<button class="btn btn-default" id="ru-change">Change</button>
</div>
<br>
<pre>var dictionary_1 = {
key_0: "",
key_1: "Первое словочочетание",
key_2: "Число после двоеточия: $Count",
key_3: [ [ "Пришла", "Пришли", "Пришло" ], " ", "$count", " ", [ "кошка", "кошки", "кошек" ] ],
key_4: {
val_1: 'Белый котёнок',
val_2: 'Чёрный котенок',
val_3: [ [ 'Пришёл', 'Пришли', 'Пришло' ], ' ', '$count', ' ', [ 'котёнок', 'котёнка', 'котят' ] ],
}
};</pre>
<br>
<pre>text_1 = translate( dictionary_1, 'ru-RU', 'key_1' );
text_2 = translate( dictionary_1, 'ru-RU', 'key_2', num );
text_3 = translate( dictionary_1, 'ru-RU', 'key_3', num );
text_4_1 = translate( dictionary_1, 'ru-RU', 'key_4.val_1' );
text_4_2 = translate( dictionary_1, 'ru-RU', 'key_4.val_2' );
text_4_3 = translate( dictionary_1, 'ru-RU', 'key_4.val_3', num );</pre>
<h3>Result</h3>
<p id="ru-key-1-value" ></p>
<p id="ru-key-2-value" ></p>
<p id="ru-key-3-value" ></p>
<h4>Nested values example:</h4>
<div style="padding-left: 15px" >
<p id="ru-key-4-1-value" ></p>
<p id="ru-key-4-2-value" ></p>
<p id="ru-key-4-3-value" ></p>
</div>
</section>
<section class="col-md-6">
<h3>English section</h3>
<div class="form-inline">
<span>Number:</span>
<input id="en-number" value="3" type="text" class="form-control">
<button class="btn btn-default" id="en-change">Change</button>
</div>
<br>
<pre>var dictionary_2 = {
key_0: "",
key_1: "First text",
key_2: "The number after: $Count",
key_3: [ [ "There is only", "There are" ], " ", "$count", " ", [ "cat", "cats" ] ],
key_4: {
val_1: 'White kitten',
val_2: 'Black kitten',
val_3: [ [ 'There is only', 'There are' ], ' ', '$count', ' ', [ 'kitten', 'kittens' ] ],
}
};</pre>
<br>
<pre>text_1 = translate( dictionary_2, 'en-US', 'key_1' );
text_2 = translate( dictionary_2, 'en-US', 'key_2', num );
text_3 = translate( dictionary_2, 'en-US', 'key_3', num );
text_4_1 = translate( dictionary_2, 'en-US', 'key_4.val_1' );
text_4_2 = translate( dictionary_2, 'en-US', 'key_4.val_2' );
text_4_3 = translate( dictionary_2, 'en-US', 'key_4.val_3', num );</pre>
<h3>Result</h3>
<p id="en-key-1-value" ></p>
<p id="en-key-2-value" ></p>
<p id="en-key-3-value" ></p>
<h4>Nested values example:</h4>
<div style="padding-left: 15px" >
<p id="en-key-4-1-value" ></p>
<p id="en-key-4-2-value" ></p>
<p id="en-key-4-3-value" ></p>
</div>
</section>
</div>
</div>
<script src="dist/translator-bundle.js" ></script>
<script src="dist/example/example.js" ></script>
</body>
</html>