Skip to content

Instantly share code, notes, and snippets.

@Alistair1231
Last active November 2, 2021 21:06
Show Gist options
  • Save Alistair1231/c8a6cc8f1715e3d1c17c1f1ce7cc74e0 to your computer and use it in GitHub Desktop.
Save Alistair1231/c8a6cc8f1715e3d1c17c1f1ce7cc74e0 to your computer and use it in GitHub Desktop.
Deepl Firefox Searchbar with Country codes

make bookmark with following content

javascript: (function (s, url = 'https://www.deepl.com/translator#___/___/___') {
    let valsRaw = s.split(" ");
    let vals = [];
    for (let i = 0; i < 2; i++) {
        vals.push(valsRaw.shift());
    }
    vals.push("");
    valsRaw.forEach((x,i,arr) => vals[vals.length-1]=vals[vals.length-1].concat(x+ " "));
    document.location.assign(url.replace(/___/g, () => (vals.shift() || '')));
})(`%s`)

picture 1

set a keyword and use like:
d de en Aufzüge sind schön
to open deepl and translate 'Aufzüge sind schön' from German to English

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment