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

"service unavailable" result of translation #23

Closed
xael-fry opened this issue Apr 9, 2015 · 42 comments
Closed

"service unavailable" result of translation #23

xael-fry opened this issue Apr 9, 2015 · 42 comments

Comments

@xael-fry
Copy link

xael-fry commented Apr 9, 2015

The addon stop working since some days, shows "service unavailable"

@bpierre
Copy link
Owner

bpierre commented Apr 9, 2015

Same here, it looks like Google really wants to close any remote access to the Google Translate service. Maybe it’s time to switch to Bing, as suggested in #4.

@xael-fry
Copy link
Author

xael-fry commented Apr 9, 2015

I manually call the url, and i get a Captcha, when filling it, I finally get the correct result.
I will try to have a deeper look.

@bpierre
Copy link
Owner

bpierre commented Apr 9, 2015

Yes same for me, and after some time, I need to fill the captcha again… I will have a look this week-end, I also have started a rewrite (not the API part though) to make it restartless and compatible with multiprocess tabs.

@rodolfobandeira
Copy link

Hi guys!
translate-shell fixed their problem. I believe if we verify their last commits we can found the solution to fix it to gTranslate.

https://github.com/soimort/translate-shell

@pautomas
Copy link

@bpierre woah! you're still mantaining it. Thanks a lot!

@bpierre
Copy link
Owner

bpierre commented Apr 10, 2015

@pautomas I am trying to! Thanks to you! I am still using it every day after all these years 🙏

@bpierre
Copy link
Owner

bpierre commented Apr 10, 2015

@rodolfobandeira Thanks, I will try to reproduce the request they are doing.

@pedro22
Copy link

pedro22 commented Apr 10, 2015

Strange if I check a longer text, eg: "Hi guys!
translate-shell Their fixed the problem. I believe if the verify Their last commits we can found the solution to fix it is gTranslate" is gTranslate every time it works well, but I'll skip this the text "Hi guys!" It appears "service unavailable"

Regards.

@IGZrobertogonzalez
Copy link

Maybe this link can help: https://support.google.com/websearch/answer/86640?hl=en

@pedro22
Copy link

pedro22 commented Apr 10, 2015

Captcha typed, but it does not help - beyond that as I wrote earlier gTranslate long sentences translators and short no.

@rodolfobandeira
Copy link

Nice shot @pedro22 ! Long sentences works.. the short ones or single words are failing.

@bpierre
Copy link
Owner

bpierre commented Apr 11, 2015

I pushed a rewrite in this branch, using Jetpack (Addons SDK) instead of XUL (Legacy Extensions): https://github.com/bpierre/gtranslate/tree/jetpack

It’s not usable yet.

The basic features are working though, including the Google Translate request. I now have to implement the language selection, test a lot, and I will publish a release as soon as possible.

@elemoine
Copy link
Contributor

Very cool @bpierre. Thanks for that!

@rodolfobandeira
Copy link

Hi @bpierre ! Thanks for the update! I just don't get it how to update my firefox extension with that one you created using Jetpack.

@bpierre
Copy link
Owner

bpierre commented Apr 12, 2015

Hi @rodolfobandeira, I will publish a .xpi as soon as it’s usable.

If you want to launch it yourself in the meantime, you have to install jpm and Firefox Nightly, then run this command in the addon directory:

$ make run

You can also build it yourself:

$ jpm xpi

@bpierre bpierre mentioned this issue Apr 13, 2015
4 tasks
@achernyakevich-tch
Copy link

I have slightly played with trying to translate different length phrases. It really looks that Google blocks almost everything that is short enough. I could detect that sentences longer than 139 symbols are translated without problems. :)

So I can suspect that Google just introduced restriction for their translation API usage trying to minimize number of calls for short phrases. Maybe we need to search for other API method for shorter sentences or find the way to assure Google that we are not spammers trying to overload its service.

@ahmadramadan
Copy link

I can't live without this plugin :(

@bpierre
Copy link
Owner

bpierre commented Apr 15, 2015

@achernyakevich Are you talking about the stable version, or the one from the jetpack branch?

@ahmadramadan Same for me! I am very busy these days, but it’s on the top of my priority list. You can follow the progress here: #24

@pedro22
Copy link

pedro22 commented Apr 15, 2015

@bpierre Can create a firefox plugin to as beta, let people test and any errors will be reported.

@bpierre
Copy link
Owner

bpierre commented Apr 15, 2015

@pedro22

Yes, I will drop a .xpi here as soon as possible, but for now it’s still too much broken and I need to fix these two points:

  • The language menu is not finished
  • The performances of the language menu generation are bad at the moment (if your computer is not fast enough, you have a delay before the context menu is displayed). I suspect the context-menu module from the Addons SDK, which is much slower than pure XUL, but I am trying to isolate the problem.

@mote0230
Copy link
Collaborator

Hi everyone, with the power of regexes I was able to fix the old version, mostly. Only thing still broken that I see is newlines and other stuff like that, it displays as \n.
You can download the xpi here: {aff87fa2-a58e-4edd-b852-0a20203c1e17}.xpi http://a.pomf.se/agntdb.xpi

Or edit the file yourself, see http://pastebin.com/GRAYnVvj the translationRequest and getGoogleUrl

@achernyakevich-tch
Copy link

@bpierre I checked for stable version 0.9 available from Mozilla Addons search.

@mote0230
Copy link
Collaborator

I spent some more time, fixed the issue with the newlines. Tried a lot to add new languages but couldn't get it to work. @bpierre feel free to use this as a temporary upgrade so people stop giving 2 star reviews.
http://a.pomf.se/gxfldu.xpi

Edit: fixed a bug where sometimes text from the examples leaked through, new version http://a.pomf.se/fsyfnz.xpi

@rodolfobandeira
Copy link

rodolfobandeira commented Apr 16, 2015

@mote0230
👍 👍 👍 👍 👍 👍 👍 👍 👍

@bpierre
Copy link
Owner

bpierre commented Apr 16, 2015

@anon0230 Thanks for the update! Sadly it can’t be submitted to the Mozilla Addons without refactoring the code: the addon needs to be compatible with E10s (see #21), which is not the case for the current codebase.

Feel free to contribute to the jetpack branch though, the Google Translate module is in providers/google-translate.js, and it shouldn’t be too much work to add your improvements into it.

PS: In case you are not familiar with GitHub: you have to fork the project, make your modifications in your jetpack branch, then create a pull request from the jetpack branch of your repo into the jetpack branch of this repo.

@def00111
Copy link

You can use this function to get the selected text (works with e10s)

function getBrowserSelection(doc) {
  const { BrowserUtils } = doc.defaultView;

  let [element, focusedWindow] = BrowserUtils.getFocusSync(doc);
  var selection = focusedWindow.getSelection().toString();
  // try getting a selected text in text input.
  if (!selection) {
    let isOnTextInput = elem => {
      // we avoid to return a value if a selection is in password field.
      // ref. bug 565717
      return elem instanceof  Ci.nsIDOMHTMLTextAreaElement ||
             (elem instanceof  Ci.nsIDOMHTMLInputElement && elem.mozIsTextField(true));
    };

    if (isOnTextInput(element)) {
      selection = element.QueryInterface(Ci.nsIDOMNSEditableElement)
                         .editor.selection.toString();
    }
  }

  if (selection) {
    selection = selection.trim().replace(/\s+/g, " ");
  }
  return selection;
}

Note: You must pass a XULDocument to the function.

@fedorvinogradov
Copy link

@mote0230 thanks a lot dude - works like a charm

@MarcoSchool
Copy link

Hope this solution gets updated into mozilla soon.
Great plugin by the way kudos.

@bpierre
Copy link
Owner

bpierre commented May 1, 2015

The release is almost ready, I just need to test it more.

Please try it and tell me if you see any issue: https://github.com/bpierre/gtranslate/releases/tag/v0.10

@bpierre bpierre closed this as completed May 1, 2015
@def00111
Copy link

def00111 commented May 1, 2015

Working good :)
I also like the detected lang feature :)

@andrew-chiz-muzychuk
Copy link

Still not working.
I uninstall and install it - nothing.
Win 7 64, FF 37.0.2

@bpierre
Copy link
Owner

bpierre commented May 1, 2015

@andrew-chiz-muzychuk have you tried to install gtranslate.xpi from this page? https://github.com/bpierre/gtranslate/releases/tag/v0.10

@andrew-chiz-muzychuk
Copy link

@bpierre no, I didn't. I went to FF's Addons and install from there. And it was v 0.9. I've tried your link. It installed v 0.10, which works perfect.
Also, I like that this menu is at the very bottom. Very usfull.
Thanks a lot!

@bpierre
Copy link
Owner

bpierre commented May 1, 2015

Great!

Also, I like that this menu is at the very bottom. Very useful.

I wasn’t sure about that… Maybe I should add an option to insert it at the top, at the bottom (as it is now), or just before the “Inspect Element”. I also need to add a separator.

Edit: #26

@bpierre
Copy link
Owner

bpierre commented May 2, 2015

The update has been approved: https://addons.mozilla.org/firefox/addon/gtranslate/

@nemesis8185
Copy link

Hello @bpierre. The new version, 0.10.1, doesn't work with Menu Editor add-on. The old GTranslate version worked fine. Please, is it possible, in some way, that GTranslate works with Menu Editor 1.2.7? I love GTranslate, but uninstalling Menu Editor, makes a chaos of all my context menus. FOr now, I'm using the temporary GTranslate that was added to this page some days ago (the temporary solution). I would really love to be able to update to GTranslate 0.10.1, as it's a great (and irreplaceable) add-on.
Thanks for your time & for this great add-on!

@bpierre
Copy link
Owner

bpierre commented May 5, 2015

@nemesis8185 Hi, could you send me the page of the Menu Editor addon? I only find “Menu Editor II”, which is deprecated by the author. I answered here for the same issue #28 (comment)

@pedro22
Copy link

pedro22 commented May 17, 2015

I updated the plugin to version 0.11.0 and I have no gTranslate item on the menu, and version 0.10.1 is - can you fix it?

Win XP SP3 - Firefox 38.0.1

@bpierre
Copy link
Owner

bpierre commented May 17, 2015

@pedro22 Could you open a new issue, and paste the results of about:support (Help => Troubleshooting Information)?

@ApeKattQuest-MonkeyPython

hi, "service unavailable" is back. and this time no matter how much or little text is selected, it's the same; it's completely unworking now.

has google completely shut it down? :(

@IGZrobertogonzalez
Copy link

@CatQuest I think it was temporary. Now it's working

@farmazon3000
Copy link

new issue: #43

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests