Code Monkey home page Code Monkey logo

Comments (3)

mote0230 avatar mote0230 commented on May 18, 2024

fixed 2ceeece
the code might use some styling

from gtranslate.

mote0230 avatar mote0230 commented on May 18, 2024

Still some issue with non-western scripts

from gtranslate.

mote0230 avatar mote0230 commented on May 18, 2024

Relevant code in chrome's official translate extension:

function(a, b, c, d) {
        if ("" != a) {
            window.selection = a;
            a = new Wf("gtx", "https://translate.googleapis.com");
            var e = chrome.i18n.getUILanguage ? chrome.i18n.getUILanguage() : "en";
            d = null != d ? d : "auto";
            var f = Ag();
            c = new M("source=" + c);
            var g = window.selection,
                k = a.a + "/translate_a/single",
                l = new M,
                v = new M;
            window.EGGS_JANGO && ("qab" == d && (l.set("slo", "qab"), d = "en"), "qab" == f && (l.set("tlo", "qab"), f = "en"));
            l.set("client", a.c);
            l.set("sl", d);
            l.set("tl", f);
            l.set("hl", e);
            Mc(l, "dt", ["t", "bd"]);
            l.set("dj", "1");
            c && l.g(c);
            v.set("q",
                g);
            Yf(a, k, l, v, t(a.f, a, b))
        }

  Yf = function(a, b, c, d, e) {
            c = c.toString();
            c += "&tk=" + Xf();
            d = d.toString();
            var f = "POST";
            b += "?" + c;
            2E3 > c.length + d.length && (f = "GET", b += "&" + d, d = "");
// ...
}

from gtranslate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.