-
Notifications
You must be signed in to change notification settings - Fork 130
/
index.html
208 lines (198 loc) · 5.71 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jQuery Lang JS Module Test Page</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" type="text/javascript"></script>
<script src="js/js.cookie.js" charset="utf-8" type="text/javascript"></script>
<script src="js/jquery-lang.js" charset="utf-8" type="text/javascript"></script>
<!--<script src="js/langpack/nonDynamic.js" charset="utf-8" type="text/javascript"></script>-->
<script type="text/javascript">
var lang = new Lang();
lang.dynamic('en', 'js/langpack/en.json');
lang.dynamic('th', 'js/langpack/th.json');
lang.init({
defaultLang: 'en'
});
</script>
<style>
body {
font-family: Verdana, Geneva, sans-serif;
font-size: 12px;
}
#langChanger {
margin-bottom: 10px;
}
.sectionTitle {
font-weight: bold;
font-size: 14px;
margin-bottom: 10px;
}
</style>
</head>
<body>
<a href="http://flattr.com/thing/352558/jQuery-Multi-Language-Site-Plugin" target="_blank">
<img src="http://api.flattr.com/button/flattr-badge-large.png" alt="Flattr this" title="Flattr this"
border="0" /></a><BR /><BR />
<div id="langChanger"><a href="#" onclick="window.lang.change('en'); return false;">Switch to English</a> | <a href="#"
onclick="window.lang.change('th'); return false;">Switch
to Thai</a></div>
<div id="testHtml">
<span lang="en">This content is not in langpack. For disableLog testing purpose...</span>
<div id="searchTitle" class="sectionTitle" lang="en" data-lang-token="propertySearch"></div>
<div lang="en" data-lang-token="translationWithDataObject" data-lang-default-data='{"firstName": "Amelia", "lastName": "Earhart"}'></div>
<div id="searchForm">
<form action="/api/search" method="post" enctype="multipart/form-data">
<table>
<tr>
<td><span lang="en">Location</span>:</td>
</tr>
<tr>
<td><input type="text" name="location" /></td>
</tr>
<tr>
<td>
<hr />
</td>
</tr>
<tr>
<td><span lang="en">Budget</span> (with placeholder text):</td>
</tr>
<tr>
<td><input lang="en" type="text" name="budgetFrom" placeholder="Budget" /></td>
</tr>
<tr>
<td><input lang="en" type="text" name="budgetTo" placeholder="Budget" /></td>
</tr>
<tr>
<td>
<hr />
</td>
</tr>
<tr>
<td><span lang="en">Min Beds</span>:</td>
</tr>
<tr>
<td>
<select name="minBeds">
<option value="0">0</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6+">6+</option>
</select>
</td>
</tr>
<tr>
<td>
<hr />
</td>
</tr>
<tr>
<td><span lang="en">Property Type</span>:</td>
</tr>
<tr>
<td>
<select name="type">
<option value="all" lang="en">Show All</option>
<option value="house" lang="en">House</option>
<option value="townhouse" lang="en">Town House</option>
<option value="apartment" lang="en">Apartment</option>
<option value="condo" lang="en">Condominium</option>
<option value="commercial" lang="en">Commercial</option>
<option value="office" lang="en">Office</option>
<option value="storage" lang="en">Storage</option>
<option value="land" lang="en">Land</option>
</select>
</td>
</tr>
<tr>
<td>
<hr />
</td>
</tr>
<tr>
<td><span lang="en">Added In</span>:</td>
</tr>
<tr>
<td>
<select name="added">
<option value="anytime" lang="en">Anytime</option>
<option value="24hours" lang="en">Last 24 Hours</option>
<option value="3days" lang="en">Last 3 Days</option>
<option value="week" lang="en">Last Week</option>
<option value="month" lang="en">Last Month</option>
</select>
</td>
</tr>
<tr>
<td>
<textarea placeholder="Anytime" lang="en"></textarea>
</td>
</tr>
<tr>
<td>
<div lang="en">Last Month <b>Moo</b> Anytime</div>:<br><BR>
<div lang="en">Last Month <b>Moo</b> Anytime</div>
</td>
</tr>
<tr>
<td>
<input type="button">:
<input type="button" value="Search..." lang="en" />
</td>
</tr>
<tr>
<td>
<button>:
<button type="button" lang="en" />
Search...</button>
</td>
</tr>
<tr>
<td>
<reset>:
<button type="reset" lang="en" />
Search...</button>
</td>
</tr>
<tr>
<td>
<img>:
<img lang="en" data-lang-token="flagImage" src="https://upload.wikimedia.org/wikipedia/en/a/ae/Flag_of_the_United_Kingdom.svg" height="150" />
</td>
</tr>
<tr>
<td>
<a>:
<a lang="en" href="http://www.google.com/">http://www.google.com/</a>
</td>
</tr>
<tr>
<td>
Click to test alert text:
<input type="button" value="Alert!" onclick="alert(window.lang.translate('propertySearch'));" />
</td>
</tr>
<tr>
<td>
Click to test loading dynamic content:
<input type="button" value="Load Dynamic..."
onclick="$('#dyn-target').append('Something Budget <span lang=\'en\'>Something Budget</span>');" />
<div id="dyn-target" lang="en"></div>
</td>
</tr>
<tr>
<td>
Long text translation with a custom defined token (data-lang-token attribute):<br>
<div lang="en" data-lang-token="lorem">Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in ...</div>
</td>
</tr>
</table>
</form>
</div>
</div>
</body>
</html>