Current UX with dictionaries is kinda crude and doesn't fit all scenarios. Often user needs to lookup for a single word only and it's not convenient to search for this word in the dictionary pane. I know about onclick navigation feature. Also dictionary search can be very heavy CPU wise on big dictionaries.
I suggest to add an ability to search for selected text in the dictionary and add a configuration checkbox to disable automatic dictionary lookup for segments. The first part is implemented here https://github.com/chelobaka/omegat/commits/dict-context-search The second one should be pretty trivial to do.
A link in the ticket body is broken, final dot symbol shouldn't be there.
I implemented GUI for disabling automatic dictionary search for segments. Please consider a pull request.
Last edit: Lev Abashkin 2018-08-20
Diff:
Without implementing the second part (manual search), is the first part (disabling automatic search) really useful? Instead, cannot you just remove the dictionary from the dictionary folder?
Didier
Disabling automatic search isn't useful by itself right now. But I don't propose it as a separate feature here.
Did you ever considered system-wide dictionaries by the way? Personally I use same dictionaries in all my projects and it would be handy to setup dictionaries only once instead of symlinking them in each project. Extra dictionaries could be added to individual projects the old way. In this scenario switching automatic dictionary search would be handy.
That was my point. I don't think it's useful integrating the pull request until the rest is complete.
You just have to change the location of dictionaries in the project properties.
Didier
I probably made myself unclear in the ticket body. Manual search was implemented in the first place, and after that I implemented checkbox for switching automatic dictionary search. The feature is working. So now I'd like to know if this feature is worth upstreaming. If you're OK with it I can polish it further. It can be useful to add a hotkey for manual search, for example.
How is your search implemented? I mean, is it something specific? The simplest implementation would be simply adding a "dictionary" checkbox in the search window, similar to the "glossary" one.
Didier
If there's a selection in the editor, context menu receives extra entry "Search selected text in dictionary". The actual search happens the same way as automatic dictionary search for a whole segment, and user sees results in the dictionary pane. Moving it to search window seems counter-productive. Usually user wants to access dictionary fast without switching windows. The whole point behind this proposal is to make external dictionary programs like Goldendict redundant for the workflow (well, optional at least). For speed reasons this action may tied to hotkey combination as well.
If you add it to the Edit menu too, then the user will be able to create a shortcut for it.
That sounds reasonable.
Will it work when automatic dictionnary search is on? The reason I'm asking is that I will leave it on, but sometimes there are two many entries and clicking on a source word doesn't always work (because of tokenizing).
Didier
It shouldn't be a problem. I'll look into this.
Yes, it actually works this way. So if you have dictionary pane filled with translations of all of segment words and you search for a specific word after that, then the dictionary pane is cleaned and found translation gets into it.
It sounds good to me.
Didier
I've made discussed changes to the branch mentioned in the body. Some commits were partially reverted, so it's better to squash them.
I decided not to disable menu item when no selection made, but to search whole segment. So even if user disables automatic dictionary search, he/she still can get the segment searched in dictionary.
Custom hotkey combination setting should look like this:
editSearchDictionaryMenuItem=ctrl GThe only point I'm not sure in is menu (popup and main) items positions.
Last edit: Lev Abashkin 2018-09-16
I would prefer Ctrl+G not to be used. Even if you do not use any default shortcut, as long as there is a menu entry, people will be able to use whatever they want.
For the main menu, behind Search and Replace seems fine to me.
For the popup, it could be
Register Identical Translation
---separator---
Search Dictionnaries
---separator
Insert Unicode Control Character
Didier
It was just my local configuration. There is no hotkey combination hardcoded for this action.
Menu items positions have been updated and pushed to github.
Implemented in SVN (/trunk).
Didier
Implemented in the published release 4.1.5 update 4 of OmegaT.
Didier