Menu

#1401 Search selected text in the dictionary

4.1
closed-fixed
None
5
2019-03-04
2018-08-19
No

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.

Discussion

  • Lev Abashkin

    Lev Abashkin - 2018-08-20

    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
  • Didier Briel

    Didier Briel - 2018-08-22
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,3 +1,3 @@
     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.
    +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.
    
     
  • Didier Briel

    Didier Briel - 2018-08-22

    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

     
    • Lev Abashkin

      Lev Abashkin - 2018-08-22

      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.

       
      • Didier Briel

        Didier Briel - 2018-08-22

        Disabling automatic search isn't useful by itself right now.

        That was my point. I don't think it's useful integrating the pull request until the rest is complete.

        Did you ever considered system-wide dictionaries by the way?

        You just have to change the location of dictionaries in the project properties.

        Didier

         
  • Lev Abashkin

    Lev Abashkin - 2018-08-22

    That was my point. I don't think it's useful integrating the pull request until the rest is complete.

    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.

     
    • Didier Briel

      Didier Briel - 2018-09-07

      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

       
      • Lev Abashkin

        Lev Abashkin - 2018-09-07

        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.

         
  • Didier Briel

    Didier Briel - 2018-09-13

    If there's a selection in the editor, context menu receives extra entry "Search selected text in dictionary".

    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.

    The actual search happens the same way as automatic dictionary search for a whole segment, and user sees results in the dictionary pane.

    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

     
    • Lev Abashkin

      Lev Abashkin - 2018-09-14

      If you add it to the Edit menu too, then the user will be able to create a shortcut for it.

      It shouldn't be a problem. I'll look into this.

      Will it work when automatic dictionnary search is on?

      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.

       
      • Didier Briel

        Didier Briel - 2018-09-15

        It sounds good to me.

        Didier

         
        • Lev Abashkin

          Lev Abashkin - 2018-09-16

          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 G

          The only point I'm not sure in is menu (popup and main) items positions.

           

          Last edit: Lev Abashkin 2018-09-16
          • Didier Briel

            Didier Briel - 2018-09-17

            Custom hotkey combination setting should look like this: >editSearchDictionaryMenuItem=ctrl G

            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.

            The only point I'm not sure in is menu (popup and main) items positions.

            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

             
            • Lev Abashkin

              Lev Abashkin - 2018-09-17

              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.

              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.

               
  • Didier Briel

    Didier Briel - 2019-02-20
    • status: open --> open-fixed
    • assigned_to: Lev Abashkin
     
  • Didier Briel

    Didier Briel - 2019-02-20

    Implemented in SVN (/trunk).

    Didier

     
  • Didier Briel

    Didier Briel - 2019-03-04
    • status: open-fixed --> closed-fixed
     
  • Didier Briel

    Didier Briel - 2019-03-04

    Implemented in the published release 4.1.5 update 4 of OmegaT.

    Didier

     

Log in to post a comment.

MongoDB Logo MongoDB