[USER JS] Opera DictCN v0.5 (English/Chinese translation - 英汉汉英翻译)
Thursday, 10. April 2008, 07:16:47
With this extension, select a word on page, and you will have short Chinese or English translation from Dict.cn, with pronunciation sounds of selected word (English or Chinese pinyin).
Download / 下载 : Opera DictCN v0.5 (zip file) or directly : Opera DictCN v0.5 (script file, 194ko)
Please note this is a BETA version.
NEW in v0.5 (from 0.4.3) :
- now with buttons and menu to put in toolbars (see Installation below) :
Note : ODictCN still work without those toolbar buttons. It's optional.
- and the small 'D' logo at bottom right of the page could now be hidden. It is useful for people experiencing slow scrolling when the small 'D' button is visible.
- seems to work with Opera 9.5 beta (but see below, Limitations)
-
add a sound volume control (please use Real alternative). Note : the first time it is shown in a page, the volume slider may take a few seconds to be accurate.
- faster loading (creates HTML elements only when first used ; removed debug printings)
- several small fixes
Installation instructions :
1/ Installation of the User Javascript :
- Copy the file ODictCN.js to a personal directory, dedicated to Opera User Javascript.
- Open menu "Tools" -> item "Preferences..." -> tab "Advanced" -> item "Content" -> button "Javascript Options"
- at the bottom of the dialog, choose the directory where the ODictCN.js is.
- click OK. Reload the currently opened pages.
2/ Installation of the toolbar buttons :
- please open that page to see all the available buttons (or open in Opera the file "buttonsODictCN.htm", included in the zip file).
- Chose the buttons you want, and drag-and-drop each one to the toolbar (for example before the URL). IMPORTANT : to drag-and-drop that kind of button, you need to click and hold the left mouse button, and then move the mouse UP or DOWN, never to the RIGHT or LEFT, go to the target position in toolbar and release the mouse button.
- a dialog will ask if you want to add that button (with a unreadable text, don't take care) : answer OK/YES.
3/ Installation of the menu associated with the main button :
- Copy the file menuODictCN.ini (in the zip file or from here) into (for Windows) :
C:\Documents and Settings\your username\Application Data\Opera\Operathe good version\profile\menu\
- Note : if you already have a custom menu file in that directory, you need to copy the menu definition of menuODictCN.ini in your file.
- Open menu "Tools" -> item "Preferences..." -> tab "Advanced" -> item "Toolbars", and in the second list (menu configuration), click on item named "ODictCN Options" (or your personal custom menu file name).
- Close options.
- Click on the small arrow near the ODictCN main toobar button, and then the menu must be available.
Limitations in v0.5 :
- as with previous versions, there's a problem with some web sites using iframes and framesets. It may not work at all with those websites.
- this version seems to work on most of websites with Opera 9.5 beta, BUT only until version 9815 (included) ; with versions from 9841 it does not work anymore. There's an Opera regression in those versions, I need to wait for a fix.
- the option "fixSlowSmoothScroll" does NOT work with Opera 9.5 beta.
- sound functions uses real player plug-in ; please use Real alternative, instead of the (very unstable) RealPlayer. I need to spend some time to use FlashPlayer, if possible.
- a very few pinyin sounds may not play with Real Alternative.
- the popup is sometimes hidden by Flash Player elements.
- Please note that like all the User Javascript extensions, ODictCN is disabled by Opera on secured web sites (HTTPS).
Hints and customisation :
- select for translation with Double-Click will work only if you disable the "Double click text to display context menu" setting in "Preferences... > Advanced > Toolbars"
- if you experience slow scrolling when the small 'D' button is visible, and don't want to hide that small button, you can edit the file ODictCN.js and set the value "this.fixSlowSmoothScroll" to true. It will change the way the 'D' button position is updated, to reduce the scrolling slowdown.
- By default, ODictCN uses the website "http://dict.cn" ; sometimes it is down, so you can also tell ODictCN to use instead the website "cn.dict.cn" ; for that, change the value "this.dictcn_server" in file ODictCN.js.
- the style of some ODictCN visible elements (popup and 'D' button in page) can be change, for example opacity or color. See and change at your convenience those styles at the beginning of file ODictCN.js.
The forum topic is here.














