-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
23 lines (21 loc) · 881 Bytes
/
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Test</title>
</head>
<body>
<p><strong>Original:</strong> <span id="text"></span></p>
<p><strong>Translated:</strong> <span id="translated"></span></p>
<script src="../../dist/doggo-translator-ts.min.js"></script>
<script>
const myTranslator = new DTT.DoggoTranslator({ userTranslationsMap: { words: { hey: 'hi', friend: 'frenn', run: 'floop' } }, suffixes: { ing: 'in' } });
const text = 'Hey friend, do you want to go for a run? I like running too!'
const translated = myTranslator.translateSentence(text)
document.querySelector('#text').innerHTML = text;
document.querySelector('#translated').innerHTML = translated;
</script>
</body>
</html>