Skip to content

Commit c2f8fd7

Browse files
committed
add tugjan keyboard
1 parent 48b5bc0 commit c2f8fd7

File tree

5 files changed

+1951
-1864
lines changed

5 files changed

+1951
-1864
lines changed

converter.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,28 @@ function uarnamala(string) {
102102

103103
return result;
104104
}
105+
106+
function tugjan(string) {
107+
let result = '';
108+
for (let i = 0; i < string.length; i++) {
109+
let letter = string[i];
110+
111+
if ('A' <= letter && letter <= "Z") {
112+
result += String.fromCharCode(letter.charCodeAt(0) + 0xe0c0 - 0x40);
113+
} else if ('a' <= letter && letter <= "z") {
114+
result += String.fromCharCode(letter.charCodeAt(0) + 0xe0e0 - 0x60);
115+
} else if ('0' <= letter && letter <= '4') {
116+
result += String.fromCharCode(letter.charCodeAt(0) + 0xe0db - 0x30);
117+
} else if ('5' <= letter && letter <= '9') {
118+
result += String.fromCharCode(letter.charCodeAt(0) + 0xe0fb - 0x35);
119+
} else if (letter === '.') {
120+
result += String.fromCharCode(0xe0c0);
121+
} else if (letter === ',') {
122+
result += String.fromCharCode(0xe0e0);
123+
} else {
124+
result += letter;
125+
}
126+
}
127+
128+
return result;
129+
}

index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ <h1><strong>Sapota</strong> Converter</h1>
1919
<option value="Rusimez">Rusimez</option>
2020
<option value="Erang">Erang</option>
2121
<option value="Uarnamala">Uarnamala</option>
22+
<option value="Tugjan">Tugjan</option>
2223
</select>
2324
</p>
2425
<p>

index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ function keyup() {
4646
textarea.value = erang(textarea.value);
4747
} else if (languageSelect.value === 'Uarnamala') {
4848
textarea.value = uarnamala(textarea.value);
49+
} else if (languageSelect.value === 'Tugjan') {
50+
textarea.value = tugjan(textarea.value);
4951
}
5052
}
5153

0 commit comments

Comments
 (0)