ssborbis / ContextSearch-web-ext

Search engine manager for modern browsers
352 stars 37 forks source link

CS as a translation-dictionary tool #206

Open Sagitee opened 5 years ago

Sagitee commented 5 years ago

Hi,

I mostly use CS as a translation-dictionary tool (not spellchecking, orthography, grammar etc.) and I’d like to suggest to you the orientation and broadening of your extension’s scope and use in that field too (of the existing one or maybe of a separate specialized fork of it).

Taking into account all the existing and expected drawbacks CS may have, in a field that it is not specialized in, after having used or tested in the past all of the following FF translation-dictionary extensions (ordered by No of FF users) and especially after your kind addition of some suggestions of me (Open in Side Bar, Simple Click and Instant last used search engine opening), I really consider that CS is already the most powerful translation-dictionary tool, well ahead of all of them and of course it could become even more effective with the addition of some proper features.

Google Translator for Firefox 500.000 To Google Translate 450.000 Google Translate, ImTranslator, Dictionary, TTS 180.000 Simple Translate 55.000 Smart Translate 50.000 Mate Translate 35.000 Google™ Translator 25.000 Google™ Translator Lite 23.000 Dictionary (Google™ Translate) Anywhere 21.000 Bing Microsoft Translator 17.000 Translate Now 16.000 Google Translate 15.000 Google Translate (In Page Translate) 13.000 Translate Man 13.000 Reverso Translate in Context 12.000 LEO Dictionaries 11.000 Google Translation 9.000 Dict.cc Translation 7.000 English Popup Dictionary 7.000 Tap Translate 6.000 Page Translator Revised 5.000 Translator (by SailorMax) 4.000 Quick Dictionary 500 Pop-Up Dictionary 300 Right Click Wiktionary 300

All of the above FF extensions, each in its own style, are mainly using an online third party service (like Google Translate, Wiktionary, Bing, etc.) and are showing the results (translation, definition, pronunciation, etymology etc.) in a popup window or in side bar (better choices as one doesn’t have to leave the current tab), in a new tab or a new window. In a few only cases a second or third and in just one case a forth such service is used.

With CS the results of hundreds of translation-dictionary web services and pages can be shown at a click’s distance.

This is valid for a great number of single language very reliable or specialized dictionaries of definitions, etymology etc. like: (English) Cambridge, Oxford, Longman, Merriam-Webster, Collins, MacMillan, American Heritage, UrbanDictionary, Etymonline, (Italian) Treccani, Garzanti, Internazionale, Corriere, Olivetti, (French) Larousse, CNRTL, (Spanish) RAE, DictLib, SpanishEtym, SpanishDict, (Greek) LSJ, Slang etc.

But also for some multilingual services (like WordReference, Glosbe, Dict.com, Forvo, Thefreedictionary etc.). Multiple search buttons-engines of each of them can be preconfigured, with the desired specific settings (source, target, presentation language combinations etc.).

It’s also possible the set up of buttons for the opening of the results’ pages of other FF translation-dictionary extensions (like Im Translate, Quick Dictionary etc.)

With the installation of Side-View extension, any web page opened in the Side Bar opens in its mobile version (if there is one which is the case on more than 90% of the translation-dictionary sites). This is very useful (as the Side Bar is of limited size and of vertical orientation) and also improves the CS FF Side Bar opened pages’ style, weight and functionality significantly, especially for result pages that contain images, pronunciation-sound buttons, videos etc., i.e. rich media content and features that are absent in most of the previously mentioned extensions. That combination of Side Bar with CS and Side-View is also useful for goggling and general searching purposes e.g. of maps, navigation, IP look up etc.

With the addition of the “Instant” last used search engine opening, a major disadvantage of CS compared to those extensions, the necessary additional click to get the results, is gone.

In fact CS has now an advantage in that aspect, as only one of those extensions have a feature like Simple Click and can translate without previously making a selection, even subtitles’ words on playing videos.

Important: With One Click and Instant last-used Search, any word in the (Side Bar) Results page can also be one click searchable within the same search engine-site, as the same tab's QM is used.

MultiTranslate-Dictionary03

MultiTranslate-Dictionary_01

ssborbis commented 5 years ago

I actually based this extension on an old greasemonkey script I wrote years ago to translate English to Spanish on right-click, so in some ways it started as a translation add-on. Now that I understand how you're using it, I can see how the repeat-search is useful.

I can't only focus on sidebar-related enhancements because Chrome doesn't have a sidebar and I'd like to keep this extension cross-browser compatible, but I can see about making translation searches more integrated. I don't do much translating so I don't have much reference to say what a good enhancement would be. My old greasemonkey script would do things like display a translated word when hovering over a word on a web page, but that script was based on parsing search results from a single, web-based translation API. Not really practical for this extension.

If you give me some specific examples of features you think would be useful to this extension, I can see about adding them.

Important: With One Click and Instant last-used Search, any word in the (Side Bar) Results page can also be one click searchable within the same search engine-site, as the same tab's QM is used.

Do you think CS should be disabled in the sidebar?

Sagitee commented 5 years ago

it started as a translation add-on

!!! May be that’s why it’s so good in that field.

I can't only focus on sidebar-related enhancements because Chrome doesn't have a sidebar and I'd like to keep this extension cross-browser compatible, but I can see about making translation searches more integrated.

I see. Without been able to know how easy or feasible that could be, what about an additional option for an in-page cross-browser extended-QM Popup, with the search engines on one side of it and the page of the results on the other e.g. left-right or top-bottom? (Something like the animated GIF attached on the issue opening comment above). Most of the translate extensions show the results in a popup window (solely or alternatively with a Toolbar or SideBar window).

would do things like display a translated word when hovering over a word on a web page

I have seen such a feature in the deprecated “Wiktionary and Google Translate” addon and in the Mouse Dictionary addon (https://addons.mozilla.org/en-US/firefox/addon/mousedictionary/). The second one works on dictionary data stored locally and is stunningly fast (but it has only some English-Japanese dictionaries). The “when hovering over a word” is a really impressive function in certain circumstances, while it can be very annoying in some others. With an easy activation-deactivation button-tool it might not be that bad idea to be implemented in some future repo for testing.

If you give me some specific examples of features you think would be useful to this extension, I can see about adding them.

Thank you. I have some suggestions in mind. I’ll open a new Github issue on each one.

Do you think CS should be disabled in the sidebar?

No! On the contrary, I mentioned it as an important advantage of CS over the other translation extensions, Only some translation sites (like GoogleTranslate, WordReference and SensAgent, Dict.com) have a similar feature.

ssborbis commented 5 years ago

Without been able to know how easy or feasible that could be, what about an additional option for an in-page cross-browser extended-QM Popup, with the search engines on one side of it and the page of the results on the other e.g. left-right or top-bottom?

Have you used the CS Sidebar menu ( not to be confused with the Firefox sidebar window ) ? It's essentially a dockable quick menu that can be set to automatically open when a tab loads, or via keyboard shortcut or a floating, movable button. Because it must be loaded into each website's DOM, it doesn't always play nice with CSS styling, but it can be moved / docked / undocked / closed when it obscures parts of a webpage. Unless I'm not understanding you, it seems pretty similar to your GIFs

Sagitee commented 5 years ago

Yes, I meant something like CS SB, but with an incorporated side area, enough for the clicked search engines to show in their resulted web pages. The GIF was intended as a whole with the content of the FF SB on the right side. The following image is from the deprecated Popup Dictionary addon. It lacked search engines buttons as in could work on one search engine each time (which could previously be set on its toolbar tool). It also had issues on many sites, and if as you have said too, such issues are expected, I can understand that a popup solution can’t be an additional cross-browser alternative to Side Bar.

PopupDict

ssborbis commented 5 years ago

Ah, an iframe for loading results pages. I'll take a look, but there may be an issue with cross-origin policy.

ssborbis commented 5 years ago

Ah, an iframe for loading results pages. I'll take a look, but there may be an issue with cross-origin policy.

Yep, dead-end.

hg42 commented 5 years ago

I just had a similar desire for a popup window. If it's not an iframe, I don't see a big difference between a tab and a new window.

Couldn't this be implemented using something like the target attribute (target="_blank")? or at least the same kind of mechanism. It may eventually be possible to choose between tab and window. When the target name is always the same this window would also be reused.

ssborbis commented 5 years ago

Maybe a Search Action for Open to Results Window, where it sends every search to the same window.

hg42 commented 5 years ago

if target or a similar mechanism would be used it could be a field for a window name, this would allow all possibilities, e.g.:

it would be really helpful to direct results to a specific window and to be able to group them.

btw: @Sagitee I didn't expect someone having even more search engines than me. And we seem to use the same method: using the folders as separator and label for the following section and I guess each folder is used as kind of overflow area for the section?

ssborbis commented 5 years ago

we seem to use the same method: using the folders as separator and label for the following section and I guess each folder is used as kind of overflow area for the section?

Ok, I see why @Sagitee was asking about displaying folders flat. He's delimiting groups of engines using an ( assumed ) empty folder. I could possibly add a "flatten" option ( folder contents are displayed in the same tier as the folder itself ) and add a color option to each folder, rendering the background / border / etc the same color for those engines from that folder. That would allow "groups" ( folder contents ) of engines to be easily distinguishable from other groups. The messy part comes with modifying the dnd methods.

Sagitee commented 5 years ago

And we seem to use the same method: using the folders as separator and label for the following section and I guess each folder is used as kind of overflow area for the section?

Hi @hg42,

Exactly described. Maybe, those who use a large number of search engines are not that many but in that case, some kind of separation (not only on single column menus), grouping (even of the top level (not in a folder) search engines) so as they could be managed (moved, hidden etc.) in groups, group labeling etc. becomes a necessity, that now can only be partly worked around with methods like ours. What do you think of the suggestion I’ve made on that, in issue #208? Is there any other idea on that?

Edit: Oops, I hadn't see your last comment @ssborbis I like the proposed color option for groups distinguishing.

ssborbis commented 5 years ago

Latest push has group options for folders with color

Open the search engines manager and double-click a folder (icon, not title ) or right-click -> edit

Checkbox for turning grouping on, color picker to set background color

You can change the style to border vs background by adding this to the user styles

.tile.groupFolder {
    background-color:revert;
    border-color: var(--group-color);
}

You should be able to move groups within the menus by dragging the parent folder, but I haven't tested much.

Sagitee commented 5 years ago

About the SE/groups/folders I continue at #208 which is more relevant.