forked from KonsomeJona/SimpleHTMLLocalizer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.html
62 lines (53 loc) · 2.07 KB
/
example.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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<script src="./user_dictionary.js" type="text/javascript"></script>
<script src="./localizer.js" type="text/javascript"></script>
<!-- Replace localizer.js with localizer_debug.js to see debug functionality
(open the browser console to see error messages) -->
<!-- uncomment to overwrite default language to German (instead of locale): -->
<!-- <script type="text/javascript">
loc_switchLangGlobal('de');
</script> -->
</head>
<body>
<h1>
SimpleHTMLLocalizer example page:
</h1>
<p>
Use navigator default language <i>(i.e. your browsers locale)</i>: <br />
<l-text key="hello_world"></l-text>
</p>
<p>
Force localizer to use Japanese: <br />
<l-text key="hello_world" lang="ja"></l-text>
</p>
<p>
Using a language with no translation available: <br />
<l-text key="hello_world" lang="xyz"></l-text>
</p>
<p>
Using a key, which is not defined in the dictionary: <br />
<l-text key="foobar"></l-text>
</p>
<p>
Using HTML elements inside the translation: <br />
<l-text key="hello_world2"></l-text>
</p>
<p>
Localized option element: <br />
<select id="fruit">
<option is="l-option" key="opt_apple" value="apple"></option>
<option is="l-option" key="opt_pear" value="pear"></option>
<option is="l-option" key="opt_orange" lang="ja" value="orange"></option>
<option is="l-option" key="opt_grape" value="grape"></option>
</select>
</p>
<p>
<l-text key="btn_lang_descr"></l-text>: <br />
<button onclick="loc_switchLangGlobal('ja')"><l-text key="btn_lang"></l-text></button><br />
You can also call loc_switchLangGlobal('ja') from your JS code.
</p>
</body>
</html>