[Userscript] Google-translated Kanji and vocab, radical mnemonic

I created a little script which auto translates the mnemonic with google translator. Sometimes they are so comedicly wrong that they stick :slight_smile:

Item Pages:

https://greasyfork.org/de/scripts/370177-autotranslate-kanji-and-vocab-page/code


Reviews:

https://greasyfork.org/de/scripts/370487-autotranslate-review


If the script detection for your language isn’t working. replace the language variable with one of the strings from here

2 Likes

I updates the script and added another one which can translate the texts in reviews.

Its perfect if you forget a English word :slight_smile:

How do I change the language? I’d like to set it to “eo” (Esperanto), but I can’t get it to change from German. I thought I could just change the array index in the beginning of the script from 0 to 23, but that did nothing. I tried a few other things but couldn’t get it to do anything but German.

If you look at this part

jQuery.getJSON({ url:"https://translate.googleapis.com/translate_a/single?client=gtx&sl=en&tl=de&dt=t&q=" + encodeURIComponent(text)}, function( ret ) {
                trans[key]= ret[0][0][1] === "Meaning Explanation" ? "": ret[0].map(x=> x[0]).join("");
                save();
            })

Replace &tl=de with &tl=eo

Looks like I had an idea with the language variable but I never implemented it so… My bad. :pensive:

2 Likes

Dankon! It’s working now. :smiley:

1 Like