aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBobIsMyManager <bobismymanager@noreply.codeberg.org>2022-07-05 22:02:32 +0200
committerManeraKai <manerakai@protonmail.com>2022-07-05 22:02:32 +0200
commit0ea6f3845e5e8317c0ac3a680ef56c2460af106c (patch)
tree144ed1d1eef46a0b5e2ae896883097d9f0e14bdc
parentupdate instances (diff)
downloadlibredirect-0ea6f3845e5e8317c0ac3a680ef56c2460af106c.zip
Added I2P and Lokinet support for simply translate. (#4)
Co-authored-by: BobIsMyManager <bimmgitsignature.nly8m@simplelogin.co> Reviewed-on: https://codeberg.org/LibRedirect/libredirect/pulls/4 Co-authored-by: BobIsMyManager <bobismymanager@noreply.codeberg.org> Co-committed-by: BobIsMyManager <bobismymanager@noreply.codeberg.org>
Diffstat (limited to '')
-rw-r--r--README.md6
-rw-r--r--package.json2
-rwxr-xr-x[-rw-r--r--]script.sh0
-rw-r--r--src/_locales/en/messages.json3
-rw-r--r--src/assets/javascripts/translate/translate.js44
-rw-r--r--src/instances/blacklist.json5
-rw-r--r--src/instances/data.json22
-rw-r--r--src/instances/get_instances.py16
-rw-r--r--src/pages/options/index.html44
-rw-r--r--src/pages/options/widgets/translate.js32
-rw-r--r--src/pages/options/widgets/translate.pug9
11 files changed, 170 insertions, 13 deletions
diff --git a/README.md b/README.md
index 26ed7f01..2c80a614 100644
--- a/README.md
+++ b/README.md
@@ -66,6 +66,12 @@ npm update
npm install
```
+If you are modifying any files ending with .pug, the pug cli needs to be installed with the following command (with root privileges):
+```
+npm install -g pug-cli
+```
+and then run `./script.sh` to generate pages in the background.
+
### Build
```
npm run build
diff --git a/package.json b/package.json
index 004b0fb9..2f8f9abf 100644
--- a/package.json
+++ b/package.json
@@ -26,4 +26,4 @@
"dependencies": {
"buffer": "^6.0.3"
}
-} \ No newline at end of file
+}
diff --git a/script.sh b/script.sh
index 00914fd1..00914fd1 100644..100755
--- a/script.sh
+++ b/script.sh
diff --git a/src/_locales/en/messages.json b/src/_locales/en/messages.json
index 33b589bd..d3b7a355 100644
--- a/src/_locales/en/messages.json
+++ b/src/_locales/en/messages.json
@@ -209,6 +209,9 @@
"i2p": {
"message": "I2P"
},
+ "loki": {
+ "message": "Lokinet"
+ },
"testInstancesLatency": {
"message": "Test Instances Latency"
}
diff --git a/src/assets/javascripts/translate/translate.js b/src/assets/javascripts/translate/translate.js
index 62cd8334..bbf08d52 100644
--- a/src/assets/javascripts/translate/translate.js
+++ b/src/assets/javascripts/translate/translate.js
@@ -9,7 +9,9 @@ const targets = [
let redirects = {
"simplyTranslate": {
"normal": [],
- "tor": []
+ "tor": [],
+ "i2p": [],
+ "loki": []
},
"lingva": {
"normal": [],
@@ -26,6 +28,10 @@ let
simplyTranslateNormalCustomRedirects,
simplyTranslateTorRedirectsChecks,
simplyTranslateTorCustomRedirects,
+ simplyTranslateI2PRedirectsChecks,
+ simplyTranslateI2PCustomRedirects,
+ simplyTranslateLokiRedirectsChecks,
+ simplyTranslateLokiCustomReidrects,
lingvaNormalRedirectsChecks,
lingvaNormalCustomRedirects,
lingvaTorRedirectsChecks,
@@ -44,6 +50,10 @@ function init() {
"simplyTranslateNormalCustomRedirects",
"simplyTranslateTorRedirectsChecks",
"simplyTranslateTorCustomRedirects",
+ "simplyTranslateI2PRedirectsChecks",
+ "simplyTranslateI2PCustomRedirects",
+ "simplyTranslateLokiRedirectsChecks",
+ "simplyTranslateLokiCustomReidrects",
"lingvaNormalRedirectsChecks",
"lingvaNormalCustomRedirects",
@@ -59,6 +69,10 @@ function init() {
simplyTranslateNormalCustomRedirects = r.simplyTranslateNormalCustomRedirects;
simplyTranslateTorRedirectsChecks = r.simplyTranslateTorRedirectsChecks;
simplyTranslateTorCustomRedirects = r.simplyTranslateTorCustomRedirects;
+ simplyTranslateI2PRedirectsChecks = r.simplyTranslateI2PRedirectsChecks;
+ simplyTranslateI2PCustomRedirects = r.simplyTranslateI2PCustomRedirects;
+ simplyTranslateLokiRedirectsChecks = r.simplyTranslateLokiRedirectsChecks;
+ simplyTranslateLokiCustomReidrects = r.simplyTranslateLokiCustomReidrects;
lingvaNormalRedirectsChecks = r.lingvaNormalRedirectsChecks;
lingvaNormalCustomRedirects = r.lingvaNormalCustomRedirects;
lingvaTorRedirectsChecks = r.lingvaTorRedirectsChecks;
@@ -84,6 +98,8 @@ function setRedirects(val) {
translateRedirects: redirects,
simplyTranslateNormalRedirectsChecks: redirects.simplyTranslate.normal,
simplyTranslateTorRedirectsChecks: redirects.simplyTranslate.tor,
+ simplyTranslateI2PRedirectsChecks: redirects.simplyTranslate.i2p,
+ simplyTranslateLokiRedirectsChecks: redirects.simplyTranslate.loki,
lingvaNormalRedirectsChecks,
lingvaTorRedirectsChecks: redirects.lingva.tor,
})
@@ -148,11 +164,17 @@ function copyPasteSimplyTranslateCookies(test, from) {
...simplyTranslateNormalCustomRedirects,
...simplyTranslateTorRedirectsChecks,
...simplyTranslateTorCustomRedirects,
+ ...simplyTranslateI2PRedirectsChecks,
+ ...simplyTranslateI2PCustomRedirects,
+ ...simplyTranslateLokiRedirectsChecks,
+ ...simplyTranslateLokiCustomReidrects,
].includes(protocolHost)) { resolve(); return; }
if (!test) {
let checkedInstances;
if (translateProtocol == 'normal') checkedInstances = [...simplyTranslateNormalRedirectsChecks, ...simplyTranslateNormalCustomRedirects]
else if (translateProtocol == 'tor') checkedInstances = [...simplyTranslateTorRedirectsChecks, ...simplyTranslateTorCustomRedirects]
+ else if (translateProtocol == 'i2p') checkedInstances = [...simplyTranslateI2PRedirectsChecks, ...simplyTranslateI2PCustomRedirects]
+ else if (translateProtocol == 'loki') checkedInstances = [...simplyTranslateLokiRedirectsChecks, ...simplyTranslateLokiCustomReidrects]
await utils.copyCookie('simplyTranslate', from, checkedInstances, 'from_lang');
await utils.copyCookie('simplyTranslate', from, checkedInstances, 'to_lang');
await utils.copyCookie('simplyTranslate', from, checkedInstances, 'tts_enabled');
@@ -170,6 +192,8 @@ function pasteSimplyTranslateCookies() {
let checkedInstances;
if (translateProtocol == 'normal') checkedInstances = [...simplyTranslateNormalRedirectsChecks, ...simplyTranslateNormalCustomRedirects]
else if (translateProtocol == 'tor') checkedInstances = [...simplyTranslateTorRedirectsChecks, ...simplyTranslateTorCustomRedirects]
+ else if (translateProtocol == 'i2p') checkedInstances = [...simplyTranslateI2PRedirectsChecks, ...simplyTranslateI2PCustomRedirects]
+ else if (translateProtocol == 'loki') checkedInstances = [...simplyTranslateLokiRedirectsChecks, ...simplyTranslateLokiCustomReidrects]
utils.getCookiesFromStorage('simplyTranslate', checkedInstances, 'from_lang');
utils.getCookiesFromStorage('simplyTranslate', checkedInstances, 'to_lang');
utils.getCookiesFromStorage('simplyTranslate', checkedInstances, 'tts_enabled');
@@ -187,6 +211,8 @@ function redirect(url, disableOverride) {
let instancesList;
if (translateProtocol == 'normal') instancesList = [...simplyTranslateNormalRedirectsChecks, ...simplyTranslateNormalCustomRedirects];
if (translateProtocol == 'tor') instancesList = [...simplyTranslateTorRedirectsChecks, ...simplyTranslateTorCustomRedirects];
+ if (translateProtocol == 'i2p') instancesList = [...simplyTranslateI2PRedirectsChecks, ...simplyTranslateI2PCustomRedirects];
+ if (translateProtocol == 'loki') instancesList = [...simplyTranslateLokiRedirectsChecks, ...simplyTranslateLokiCustomReidrects];
if (instancesList.length === 0) return;
const randomInstance = utils.getRandomInstance(instancesList)
@@ -221,9 +247,13 @@ function switchInstance(url, disableOverride) {
if (![
...translateRedirects.simplyTranslate.normal,
...translateRedirects.simplyTranslate.tor,
+ ...translateRedirects.simplyTranslate.i2p,
+ ...translateRedirects.simplyTranslate.loki,
...simplyTranslateNormalCustomRedirects,
...simplyTranslateTorCustomRedirects,
+ ...simplyTranslateI2PCustomRedirects,
+ ...simplyTranslateLokiCustomReidrects,
...translateRedirects.lingva.normal,
...translateRedirects.lingva.tor,
@@ -241,6 +271,14 @@ function switchInstance(url, disableOverride) {
if (translateFrontend == 'simplyTranslate') instancesList = [...simplyTranslateTorRedirectsChecks, ...simplyTranslateTorCustomRedirects];
else if (translateFrontend == 'lingva') instancesList = [...lingvaTorRedirectsChecks, ...lingvaTorCustomRedirects];
}
+ else if (translateProtocol == 'i2p') {
+ if (translateFrontend == 'simplyTranslate') instancesList = [...simplyTranslateI2PRedirectsChecks, ...simplyTranslateI2PCustomRedirects];
+ //else if (translateFrontend == 'lingva') instancesList = [...lingvaI2PRedirectsChecks, ...lingvaI2PCustomRedirects];
+ }
+ else if (translateProtocol == 'loki') {
+ if (translateFrontend == 'simplyTranslate') instancesList = [...simplyTranslateLokiRedirectsChecks, ...simplyTranslateLokiCustomReidrects];
+ //else if (translateFrontend == 'lingva') instancesList = [...lingvaLokiRedirectsChecks, ...lingvaLokiCustomRedirects];
+ }
const i = instancesList.indexOf(protocolHost);
if (i > -1) instancesList.splice(i, 1);
@@ -274,6 +312,10 @@ function initDefaults() {
simplyTranslateNormalCustomRedirects: [],
simplyTranslateTorRedirectsChecks: [...redirects.simplyTranslate.tor],
simplyTranslateTorCustomRedirects: [],
+ simplyTranslateI2PRedirectsChecks: [...redirects.simplyTranslate.i2p],
+ simplyTranslateI2PCustomRedirects: [],
+ simplyTranslateLokiRedirectsChecks: [...redirects.simplyTranslate.loki],
+ simplyTranslateLokiCustomReidrects: [],
lingvaNormalRedirectsChecks: lingvaNormalRedirectsChecks,
lingvaNormalCustomRedirects: [],
diff --git a/src/instances/blacklist.json b/src/instances/blacklist.json
index 318226f5..d2811d2c 100644
--- a/src/instances/blacklist.json
+++ b/src/instances/blacklist.json
@@ -35,9 +35,12 @@
"https://teddit.httpjames.space",
"https://teddit.encrypted-data.xyz",
"https://wiki.604kph.xyz",
+ "https://wikiless.lunar.icu",
+ "https://lingva.lunar.icu",
"https://searx.josie.lol",
"https://searx.org",
"https://searx.run",
+ "https://searx.albony.xyz",
"https://searx.kujonello.cf",
"https://search.albony.xyz",
"https://search.garudalinux.org",
@@ -47,4 +50,4 @@
"authenticate": [
"https://nitter.nixnet.services"
]
-} \ No newline at end of file
+}
diff --git a/src/instances/data.json b/src/instances/data.json
index 113b6b7d..1598128b 100644
--- a/src/instances/data.json
+++ b/src/instances/data.json
@@ -14,6 +14,7 @@
"https://invidious.sethforprivacy.com",
"https://inv.bp.projectsegfau.lt",
"https://invidious.projectsegfau.lt",
+ "https://invidious.lunar.icu",
"https://invidious.nerdvpn.de",
"https://inv.vern.cc",
"https://invidious.slipfox.xyz",
@@ -26,7 +27,6 @@
"http://c7hqkpkpemu6e7emz5b4vyz7idjgdvgaaa3dyimmeojqbgpea3xqjoid.onion",
"http://w6ijuptxiku4xpnnaetxvnkc5vqcdu7mgns2u77qefoixi63vbvnpnqd.onion",
"http://kbjggqkzv65ivcqj6bumvp337z6264huv5kpkwuv6gu5yjiskvan7fad.onion",
- "http://grwp24hodrefzvjjuccrkw3mjq4tzhaaq32amf33dzpmuxe7ilepcmad.onion",
"http://osbivz6guyeahrwp2lnwyjk2xos342h4ocsxyqrlaopqjuhwn2djiiyd.onion",
"http://u2cvlit75owumwpy4dj2hsmvkq7nvrclkpht7xgyye2pyoxhpmclkrad.onion",
"http://euxxcnhsynwmfidvhjf6uzptsmh4dipkmgdmcmxxuo7tunp3ad2jrwyd.onion/",
@@ -377,6 +377,12 @@
"http://fyng2tsmzmvxmojzbbwmfnsn2lrcyftf4cw6rk5j2v2huliazud3fjid.onion",
"http://xxtbwyb5z5bdvy2f6l2yquu5qilgkjeewno4qfknvb3lkg3nmoklitid.onion",
"http://translate.prnoid54e44a4bduq5due64jkk7wcnkxcp5kv3juncm7veptjcqudgyd.onion"
+ ],
+ "i2p": [
+ "http://kmnkkp4v4ublygtnyq46oacy3qw75nrxxniriuaersumw7bfsm2a.b32.i2p"
+ ],
+ "loki": [
+ "http://translate.priv.loki"
]
},
"lingva": {
@@ -397,7 +403,8 @@
"http://z5vawdol25vrmorm4yydmohsd4u6rdoj2sylvoi3e3nqvxkvpqul7bqd.onion",
"http://zbuc3bbzbfdqqo2x46repx2ddajbha6fpsjeeptjhhhhzji3zopxdqyd.onion",
"http://f4qfqajszpx5b7itzxt6mb7kj4ktpgbdq7lq6xaiqyqx6a7de3epptad.onion",
- "http://rq2w52kyrif3xpfihkgjnhqm3a5aqhoikpv72z3drpjglfzc2wr5z4yd.onion"
+ "http://rq2w52kyrif3xpfihkgjnhqm3a5aqhoikpv72z3drpjglfzc2wr5z4yd.onion",
+ "http://searx.bsbvtqi5oq2cqzn32zt4cr2f2z2rwots3dq7gmdcnlyqoxko2wx6reqd.onion"
],
"i2p": [
"http://ransack.i2p",
@@ -408,6 +415,8 @@
"https://dynabyte.ca",
"https://jsearch.pw",
"https://nibblehole.com",
+ "https://search.antonkling.se",
+ "https://search.chemicals-in-the-water.eu",
"https://procurx.pt",
"https://search.ethibox.fr",
"https://search.jpope.org",
@@ -427,6 +436,7 @@
"https://searx.nixnet.services",
"https://searx.openhoofd.nl",
"https://searx.org",
+ "https://searx.ppeb.me",
"https://searx.pwoss.org",
"https://searx.rasp.fr",
"https://searx.ru",
@@ -477,7 +487,6 @@
"https://search.ashs.club",
"https://search.bingowaves.xyz",
"https://search.bus-hit.me",
- "https://search.chemicals-in-the-water.eu",
"https://search.disroot.org",
"https://search.mdosch.de",
"https://search.neet.works",
@@ -489,6 +498,7 @@
"https://search.unlocked.link",
"https://search.vojkovic.xyz",
"https://search.zzls.xyz",
+ "https://searx.albony.xyz",
"https://searx.be",
"https://searx.becomesovran.com",
"https://searx.chocoflan.net",
@@ -607,6 +617,7 @@
"https://infothema.net",
"https://tube.nilsu.org",
"https://peertube.nrsk.no",
+ "https://peertube.today",
"https://podlibre.video",
"https://videos.tankernn.eu",
"https://watch.autonomous-zone.earth",
@@ -630,8 +641,10 @@
"https://tube.nestor.coop",
"https://live.oldskool.fi",
"https://dytube.com",
+ "https://video.toby3d.me",
"https://tube.thierrytalbert.fr",
"https://peertube.informaction.info",
+ "https://peertube.thele.me",
"https://tube.ac-amiens.fr",
"https://tube.alado.space",
"https://tube.network.europa.eu",
@@ -853,6 +866,7 @@
"https://tube.1o1.io",
"https://peertube.aventer.biz",
"https://videos.rights.ninja",
+ "https://pertur.be",
"https://tube.pilgerweg-21.de",
"https://freediverse.com",
"https://pocketnetpeertube2.nohost.me",
@@ -1582,4 +1596,4 @@
"https://peertube2.cpy.re",
"https://peertube.cpy.re"
]
-} \ No newline at end of file
+}
diff --git a/src/instances/get_instances.py b/src/instances/get_instances.py
index 7c270843..098bc38b 100644
--- a/src/instances/get_instances.py
+++ b/src/instances/get_instances.py
@@ -279,6 +279,7 @@ def libremdb():
_list['tor'].append(item)
else:
_list['normal'].append(item)
+
mightyList['libremdb'] = _list
print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'Libremdb')
@@ -295,6 +296,16 @@ def simplytranslate():
for item in r.text.strip().split('\n'):
simplyTranslateList['tor'].append('http://' + item)
+ r = requests.get('https://simple-web.org/instances/simplytranslate_i2p')
+ simplyTranslateList['i2p'] = []
+ for item in r.text.strip().split('\n'):
+ simplyTranslateList['i2p'].append('http://' + item)
+
+ r = requests.get('https://simple-web.org/instances/simplytranslate_loki')
+ simplyTranslateList['loki'] = []
+ for item in r.text.strip().split('\n'):
+ simplyTranslateList['loki'].append('http://' + item)
+
mightyList['simplyTranslate'] = simplyTranslateList
print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'SimplyTranslate')
@@ -308,6 +319,7 @@ def linvgatranslate():
lingvaList['tor'] = []
for item in rJson:
lingvaList['normal'].append(item)
+
mightyList['lingva'] = lingvaList
print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'LinvgaTranslate')
@@ -432,9 +444,9 @@ for k1, v1 in mightyList.items():
mightyList[k1][k2].remove(instance)
print("removed " + instance)
else:
- if not instance.endswith('.onion') and not instance.endswith('.i2p') and is_cloudflare(instance):
+ if not instance.endswith('.onion') and not instance.endswith('.i2p') and not instance.endswith('.loki') and is_cloudflare(instance):
cloudflare.append(instance)
- if not instance.endswith('.onion') and not instance.endswith('.i2p') and is_authenticate(instance):
+ if not instance.endswith('.onion') and not instance.endswith('.i2p') and not instance.endswith('.loki') and is_authenticate(instance):
authenticate.append(instance)
peertube()
diff --git a/src/pages/options/index.html b/src/pages/options/index.html
index 6d97cfac..241a20e7 100644
--- a/src/pages/options/index.html
+++ b/src/pages/options/index.html
@@ -1765,6 +1765,8 @@
<select id="translate-protocol">
<option value="normal" data-localise="__MSG_normal__">Normal</option>
<option value="tor" data-localise="__MSG_tor__">Tor</option>
+ <option value="i2p" data-localise="__MSG_i2p__">I2P</option>
+ <option value="loki" data-localise="__MSG_loki__">Lokinet</option>
</select>
</div>
<hr>
@@ -1820,6 +1822,48 @@
</form>
<div class="checklist custom-checklist"></div>
</div>
+ <div class="i2p">
+ <div class="some-block option-block">
+ <h4 data-localise="__MSG_defaultInstances__">Default Instances</h4>
+ </div>
+ <div class="checklist"></div>
+ <hr>
+ <div class="some-block option-block">
+ <h4 data-localise="__MSG_customInstances__">Custom Instances</h4>
+ </div>
+ <form class="custom-instance-form">
+ <div class="some-block option-block">
+ <input class="custom-instance" placeholder="http://simplytranslate.i2p" type="url">
+ <button class="add add-instance" type="submit">
+ <svg xmlns="https://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor">
+ <path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"></path>
+ </svg>
+ </button>
+ </div>
+ </form>
+ <div class="checklist custom-checklist"></div>
+ </div>
+ <div class="loki">
+ <div class="some-block option-block">
+ <h4 data-localise="__MSG_defaultInstances__">Default Instances</h4>
+ </div>
+ <div class="checklist"></div>
+ <hr>
+ <div class="some-block option-block">
+ <h4 data-localise="__MSG_customInstances__">Custom Instances</h4>
+ </div>
+ <form class="custom-instance-form">
+ <div class="some-block option-block">
+ <input class="custom-instance" placeholder="http://simplytranslate.loki" type="url">
+ <button class="add add-instance" type="submit">
+ <svg xmlns="https://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor">
+ <path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"></path>
+ </svg>
+ </button>
+ </div>
+ </form>
+ <div class="checklist custom-checklist"></div>
+ </div>
</div>
<div id="lingva">
<div class="normal">
diff --git a/src/pages/options/widgets/translate.js b/src/pages/options/widgets/translate.js
index 3e1f53eb..04869b63 100644
--- a/src/pages/options/widgets/translate.js
+++ b/src/pages/options/widgets/translate.js
@@ -22,6 +22,8 @@ function changeFrontendsSettings() {
function changeProtocolSettings() {
const normalSimplyTranslateDiv = document.getElementById("simplyTranslate").getElementsByClassName("normal")[0];
const torSimplyTranslateDiv = document.getElementById("simplyTranslate").getElementsByClassName("tor")[0];
+ const i2pSimplyTranslateDiv = document.getElementById("simplyTranslate").getElementsByClassName("i2p")[0];
+ const lokiSimplyTranslateDiv = document.getElementById("simplyTranslate").getElementsByClassName("loki")[0];
const normalLingvaDiv = document.getElementById("lingva").getElementsByClassName("normal")[0];
const torLingvaDiv = document.getElementById("lingva").getElementsByClassName("tor")[0];
@@ -29,14 +31,34 @@ function changeProtocolSettings() {
if (protocol.value == 'normal') {
normalSimplyTranslateDiv.style.display = 'block';
normalLingvaDiv.style.display = 'block';
- torLingvaDiv.style.display = 'none';
torSimplyTranslateDiv.style.display = 'none';
+ torLingvaDiv.style.display = 'none';
+ i2pSimplyTranslateDiv.style.display = 'none';
+ lokiSimplyTranslateDiv.style.display = 'none';
}
else if (protocol.value == 'tor') {
normalSimplyTranslateDiv.style.display = 'none';
normalLingvaDiv.style.display = 'none';
- torLingvaDiv.style.display = 'block';
torSimplyTranslateDiv.style.display = 'block';
+ torLingvaDiv.style.display = 'block';
+ i2pSimplyTranslateDiv.style.display = 'none';
+ lokiSimplyTranslateDiv.style.display = 'none';
+ }
+ else if (protocol.value == 'i2p') {
+ normalSimplyTranslateDiv.style.display = 'none';
+ normalLingvaDiv.style.display = 'none';
+ torSimplyTranslateDiv.style.display = 'none';
+ torLingvaDiv.style.display = 'none';
+ i2pSimplyTranslateDiv.style.display = 'block';
+ lokiSimplyTranslateDiv.style.display = 'none';
+ }
+ else if (protocol.value == 'loki') {
+ normalSimplyTranslateDiv.style.display = 'none';
+ normalLingvaDiv.style.display = 'none';
+ torSimplyTranslateDiv.style.display = 'none';
+ torLingvaDiv.style.display = 'none';
+ i2pSimplyTranslateDiv.style.display = 'none';
+ lokiSimplyTranslateDiv.style.display = 'block';
}
}
@@ -66,10 +88,12 @@ translate.addEventListener("change", () => {
})
-utils.processDefaultCustomInstances('translate', 'simplyTranslate', 'normal', document)
+utils.processDefaultCustomInstances('translate', 'simplyTranslate', 'normal', document);
utils.processDefaultCustomInstances('translate', 'simplyTranslate', 'tor', document);
+utils.processDefaultCustomInstances('translate', 'simplyTranslate', 'i2p', document);
+utils.processDefaultCustomInstances('translate', 'simplyTranslate', 'loki', document);
utils.processDefaultCustomInstances('translate', 'lingva', 'normal', document);
utils.processDefaultCustomInstances('translate', 'lingva', 'tor', document);
utils.latency('translate', 'simplyTranslate', document, location, true)
-utils.latency('translate', 'lingva', document, location, true) \ No newline at end of file
+utils.latency('translate', 'lingva', document, location, true)
diff --git a/src/pages/options/widgets/translate.pug b/src/pages/options/widgets/translate.pug
index 6fc9b38c..c29d75e1 100644
--- a/src/pages/options/widgets/translate.pug
+++ b/src/pages/options/widgets/translate.pug
@@ -17,6 +17,8 @@ section#translate_page.option-block
select#translate-protocol
option(value="normal" data-localise="__MSG_normal__") Normal
option(value="tor" data-localise="__MSG_tor__") Tor
+ option(value="i2p" data-localise="__MSG_i2p__") I2P
+ option(value="loki" data-localise="__MSG_loki__") Lokinet
hr
#simplyTranslate
@@ -28,6 +30,13 @@ section#translate_page.option-block
.tor
include ../../widgets/instances.pug
+instances('http://hxecvvetgrznmprg.onion')
+ .i2p
+ include ../../widgets/instances.pug
+ +instances('http://simplytranslate.i2p')
+ .loki
+ include ../../widgets/instances.pug
+ +instances('http://simplytranslate.loki')
+
#lingva
.normal
include ../../widgets/instances.pug