Skip to content
This repository has been archived by the owner on Nov 22, 2022. It is now read-only.

Commit

Permalink
Removed dictionary feature (Google removed it)
Browse files Browse the repository at this point in the history
  • Loading branch information
bpierre committed Nov 4, 2011
1 parent aefffdd commit 22153d2
Show file tree
Hide file tree
Showing 3 changed files with 103 additions and 140 deletions.
9 changes: 2 additions & 7 deletions src/chrome/content/googtrans/GoogleTranslate.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,15 @@ if ("undefined" === typeof(GoogleTranslate)) {
translationRequest: function(langFrom, langTo, text, onLoadFn, onErrorFn) {
var url = this.getGoogleUrl("api", langFrom, langTo, text);

var req = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"]
var req = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"]
.createInstance(Ci.nsIXMLHttpRequest);

req.addEventListener("load", (function() {
if (req.status !== 200) {
onErrorFn(req.statusText);
return;
}

var response = JSON.parse(req.responseText);

if (!response.sentences) {
Expand Down Expand Up @@ -175,11 +175,6 @@ if ("undefined" === typeof(GoogleTranslate)) {
case "page":
formattedUrl = 'http://translate.google.com/#' + langFrom + '%7C' + langTo + '%7C' + encodeURIComponent(text);
break;

// Google Translate Dictionary
case "dict":
formattedUrl = 'http://www.google.com/dictionary?langpair=' + langFrom + '%7C' + langTo + '&q=' + encodeURIComponent(text);
break;
}

return formattedUrl;
Expand Down
Loading

0 comments on commit 22153d2

Please sign in to comment.