Friday, October 8, 2010

Firefox Extension: Wiktionary and Google Translate





NOTE: Many users have asked whether there will be a WebExtension version of this add-on. We appreciate your support. Unfortunately, there is no plan of such development in the near future as we do not have the time/resources. This extension may stop working when XUL is deprecated.

The extension brings two convenient new features to your Firefox browser:
  • in-line dictionary: select or hover over any word or phrase to get an immediate definition of it in your own language and/or in English;
  • translation of the whole page with just a single click.
Note: You should choose your language (see the Options section below) before using the extension.

In-line Dictionary


Move your mouse over a word or select to highlight it, then press down the Ctrl and Shift keys together. A little pop-up will show the definition of it in your language.


The top left corner shows the word or phrase that is looked up. Click on the little speaker icon and you can hear the pronunciation of the word. Blow the speaker icon is the pronunciation in the IPA notation.

The top right corner gathers a set of convenient buttons that let you configure the extension, copy/look up text on the pop-up, and close the pop-up.

The definition of the word is shown with relevant images on the right side (an optional feature when you activate the Show Images feature).

Near the bottom of the little pop-up, there is a "more" link which will lead you to the full definition of the word at the Wiktionary web site. 

To close the little pop-up, just click on any blank place on the browser, or press the Esc button. The little pop-up must be closed before you can activate another in-line look-up. You have the option to close the pop-up by moving the mouse away, but you need to enable it first (see the Options section below).

Alternative ways

Besides the shortcut keys, you can use the in-line dictionary in two other ways:
  1. Use the Wiktionary toolbar button . You can drag this button from the toolbar palette to your toolbar. (See this and this posts for how to add a button from the palette into your toolbar.) To use it, highlight the word/phrase you want to look up and click on the button to reveal its definition.
  2. Use the Wiktionary button in the context menu. To use it, highlight the word/phrase you want to look up and right click to show the context menu. From the context menu, click on the Wiktionary item.

Buttons on the pop-up

  • Open the Options dialogue of the extension.
  • Select or highlight some text on the pop-up, and click this icon to copy it into the clipboard. You can later paste the text to your documents or wherever you want.
  • Select or highlight a word on the pop-up, and click this icon to look up its definition.
  • To go to the Meet the Developer page on Mozilla's web site. There you can make a donation through mozilla.org to support this project. We appreciate any contribution (of any amount) and promotion.
  • To close the pop-up of the definition.

Showing images

It is an advanced feature that requires some manual set-up. After it is properly set up, relevant images of the word you are looking up will be shown on the right side of the definition. It can help you better understand the word and it is scientifically proved that images can help memorizing stuff. Give it a try if you have several minutes to spend.

Bilingual

If you choose a language other than English, you have the option to turn on the English definition alongside the definition in your language.

Why would one want to do that? Firstly, the English dictionary is the most mature and complete in Wiktionary.org. You can compare the definitions in both language and may get better understanding with the English definition. Secondly, it is a way to learn English.

Page Translation


The Google Translate button can be found in the toolbar palette. You can drag and drop it into your toolbar to enable 1-click whole page translation into your own language. See this and this posts for how to add a button from the palette into your toolbar.



Alternatively, you can right click to access the context menu, then select Translate Page.


Options


Open the Options dialog to setup the extension.


  • Select your language
The extension tries to detect your language the first time you install it. But you can make an explicit choice here. Below it, you can check the "Look up in English too" checkbox to show the English definition alongside the one in your language.
  • Enable select-to-translate
If it is checked, you can double-click any word or highlight a phrase to see the in-line translation.

  • Enable double-click-to-translate
If it is checked, you can double-click any word to see the in-line translation. With this new option, you can uncheck the above Enable select-to-translate option which may cause inconvenience when you want to copy & paste some text from the web page.
  • Enable hover-to-translate
If it is checked, you can press down the Ctrl key (or Ctrl+Shift or Ctrl+Alt) and move your mouse over the word to view the in-line definition of it.
  • Aggressive mode
If it is not checked, you must press down the Ctrl key (or Ctrl+Shift or Ctrl+Alt) first and keep it down when you move the mouse to translate a word. If you want to know the technical detail, read the section "What is aggressive mode".
  • Move mouse away to close the pop-up
This option is for the in-line dictionary. If it is checked, you can close the pop-up by moving the mouse away so that you do not need to click somewhere like before. This option is disable by default so the existing users do not get surprised after the upgrade.
  • Always use secure Wiktionary
This option is for the in-line dictionary. If it is checked, it always uses the secure link to query the Wiktionary. This option helps to avoid the intervention from another extension HTTP Everywhere (see the Q&A section for details).
  • Translate page in a new tab 
This option is for the whole page translation function. If it is checked, a new tab is opened for translating the page. The page's link is sent to translate.google.com instead of using the Google Translate Element. This option helps to limit the intervention from another extension NoScript.

Style tab

The user can apply his/her own style to the in-line dictionary pop-up.


  • Enable my style
If it is checked, the CSS code in the following input box will be applied to the extension to let user override the default style. There are some samples of the CSS code can be found here. They can be simply copied and pasted into the input box.

Advanced tab

You can enable the Show Images feature here. See this post for this advanced feature.
 

Download


Download the extension from the official Mozilla Add-ons web site:

https://addons.mozilla.org/en-US/firefox/addon/google-dictionary-and-google-t/

Q&A


It doesn't work. Why?

Wiktionary and Google Translate extension can be intervened by other extensions. Those extensions either block the requests being sent out or alter the requests. So far, users have discovered that Flashblock, NoScript and HTTPS Everywhere can break Wiktionary and Google Translate.

To make Wiktionary and Google Translate works with Flashblock, please read this post.

For NoScript which blocks the page translation function, there is no simple solution yet. Google Translate needs to run JavaScript on the page you want to translate to translate it. So you have to temporary enable scripts on the page you want to translate before you run the Translate Page function. Another solution is added in version 5.10 -- in the Options dialog, you can check the option *Translate page in a new tab (only for unsecured URI)* to get the page translated on Google Translate web site. Therefore you only need to add translate.google.com to NoScript's white list.

HTTPS Everywhere alerts your request to Wiktionary. The rule in concern is named Wikipedia in its default ruleset. To use our extension, you will need to disable the rule named Wikipedia. If you do not want to disable that rule, you can use a workaround we added in version 5.10 -- in the Options dialog, check the option *Always use secure Wiktionary*. That will always send queries to Wiktionary via HTTPS protocol so HTTPS Everywhere will not try to alter your requests. But since all the sound files are transferred by HTTP protocol only, they will still be broken by HTTPS Everywhere. Therefore, you will not see voice pronunciation icons if HTTPS Everywhere is enabled for Wikipedia.

Another reason that Translate Page function does not work is that Google Translate does not support the language you are using. You can temporary switch your language to a popular one, such as English or French, to see whether it is because of the language.

There may be more extensions that break our extension. To find out, you can disable the extensions you have installed one by one. The most suspicious ones are those that block or alter things.

What is aggressive mode?

In aggressive mode, the extension keeps on capturing the words your mouse hovering over at any time. The words are captured but they are not sent out to Google until you press the Ctrl key. Whenever you press the Ctrl key, the word under the mouse will get translated. It adds some overhead but usually does not matter because your browser is idle while you are reading the page.

However, if you do not like the idea of keeping the browser active, you can uncheck it. Then the mouse only captures words when you are pressing down the Ctrl key.

Whole page translation is blocked by Flashblock extension.

That is because Flashblock extension blocks some Google online services. You need to add google.com or the regional Google URL to the white list of Flashblock. There is nothing our extension can do because it is outside of its scope. See the reason and detail in this post.

Why isn't Firefox 3.5 supported?

Firefox 3.5 is too old to meet the requirement of this extension, we do not plan to add extra fix for it.

When realizing the above requirement, you can make a little change yourself to get it installed. Just change the value of "em:minVersion" from 3.6 to 3.5 in the file install.rdf. However, we do not know whether the extension can function properly with Firefox 3.5 and we do not support it.

New features.

Any suggestions and requests are welcome. If the feature you request does not show up in the new release, please be patient. We will add new features according to their priorities. In the meantime, bug-fixes are our number one priority.

213 comments:

«Oldest   ‹Older   201 – 213 of 213
欸特 said...

I found that the link of translated word leads to https://translate.google.com/#auto|zh-TW|someword, it should be https://translate.google.com/#auto/zh-TW/someword.

Anonymous said...

Thanks for a fantastic addon!

Please add electrolysis/e10s/multiprocess support!

Anonymous said...

One of my favorite add-ons, and great for when I come across words that I don't recognize, but I've stopped using it temporarily until it gets multiprocess support (since it's the only incompatible add-on that I'd be running).

Diego said...

Please update this fantastic addon to make it e10s (multiprocess) compatible. Many thanks.

Unknown said...

The Sci-Hub "dark web" Open Access to research papers service sends you to a link like this:
http://onlinelibrary.wiley.com.sci-hub.cc/doi/10.1002/ptr.2650040104/abstract

But it puts a Captcha page on your screen, all in Russian, hiding the actual paper. Once you've passed the Captcha the first time, that link goes directly to the paper. I guess your full page translation function only sees the URL, decides the actual paper is in English, and doesn't know I'm staring at a lot of Russian I don't understand. I was finally able to select and translate bits of it at a time. Maybe that's all you can do?

But why does the Google page say "Translating..." at the top, and show nothing of my content, until I click the "Translating..." link?

Oh, wait! Tried again with another paper:
http://tandfonline.com.sci-hub.cc/doi/abs/10.3109/10799893.2014.917325?mobileUi=0&journalCode=irst20
There the full page translate function translates the Russian Captcha page content! But only after I click "Translating...", and if I click the "original" button I have to click "Translating..." again to see that version.

Hmmm... Every time I click "Translating..." and the new (translation or original) content appears, Firefox drops down its "prevented a redirect" banner. Could it be that the redirect was supposed to happen automatically and replace the "Translating..." link page? And something is blocking the banner that tells me the redirect was blocked - until I've clicked "Translating..." and am already seeing the changed page? If I manually allow the redirect then, nothing changes (except the dropdown goes away.) The URL doesn't change a bit between versions, so I'm lost as to how this is all happening...

So it appears the built-in Firefox redirect blocker (about:preferences#advanced -> General -> Accessibility -> Warn me when websites try to redirect or reload the page) may be interfering with the full-page translation. I've seen that for months now and wondered why I had to click "Translating..." to see my content...

Anonymous said...

You should make this extension for Chrome beacause it's perfect translator!

yokim825 said...

It did not compatible(version 7.5) with multi-process(e10s) enable in Firefox version 54 (windows 7 Pro x64), would you please check it ? Thank you in advance.

Martin Koberstein said...

Do you plan to make a webextension version of your fantastic addon? Would be awesome..

Minh Tấn said...

I've just update Firefox 57 version some minutes before. Thank you for developing a very very useful extension. I found this one in 2013. This extension helped me a lot until minutes before. :(. I hope someday it would revive with "Legacy" tag.

Dak Lan said...

"This add-on is not compatible with your version of Firefox."
:((

Mr Cole said...

This add-on was perfect... I can't find a decent replacement that opens a page in Google Translate so easily since Firefox updated. Please update this add-on, or if anyone else has some recommendations, glad to hear them!

Radio consultant said...

This was THE plugin we used for translation.
The Firefox update makes me annoyed...

Would be great to have a working version - but with limited resources it is understandable to leave it...

Thanks for this product anyhow!

Chill

Anonymous said...

Please update for last Firefox

«Oldest ‹Older   201 – 213 of 213   Newer› Newest»
 
Get This <