-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocument-write.html
47 lines (41 loc) · 993 Bytes
/
document-write.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 dir="ltr" lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Document write</title>
<script>
const libUrl = location.hostname.includes('localhost')
? '../../ultimate-i18n-js/lib/index.js'
: 'https://cdn.jsdelivr.net/npm/[email protected]/lib/index.min.js';
document.write(`<script src="${libUrl}"><\/script>`);
</script>
</head>
<body>
<script>
document.write(
`<h1
i18n-pl="Witaj świecie"
i18n-es="Hola Mundo">
Hello World
</h1>
<section>
<span
i18n-pl="Kocham czerwony"
i18n-es="Amo el rojo">
I love red
</span>
</section>`);
</script>
<p>
<span
i18n-pl="Zmień język:"
i18n-es="Cambiar idioma:">
Change language:
</span>
<a href="javascript:UltimateI18n.set('pl');">pl</a> /
<a href="javascript:UltimateI18n.set('es');">es</a> /
<a href="javascript:UltimateI18n.set('en');">en</a>
</p>
</body>
</html>