Description of problem: User story: As a casual translator I want my search terms highlighted in Suggestions from the Translation Memory. Current view show the diff between the search terms and translation memory. However this view: 1. Does not provide an easy view where the search terms located in translation memory suggestions. 2. Does not match the usual behaviour of "search result", which only highlights exact search terms. 3. Does not look good for long source messages and translation memory suggestion. Scrolling is needed to see whole sentences. See attachment for how it looks like for long strings. Version-Release number of selected component (if applicable): Zanata version 1.6.1-SNAPSHOT (20120608-0019). How reproducible: Always Steps to Reproduce: 1. Ensure the translation memory has something to show. (Translated messages exists) 2. Visit any document 3. Search on any string that the translation memory is likly to contain, such as "Enable" or "Ok" Actual results: Only diff view is presented. Expected results: An option is available for highlight only the search terms.
Created attachment 591099 [details] Screenshot that demonstrates the issue
The attachment does not seem to have a search item in the search box. However the error can be replicated. Requesting for technical evaluation.
The screenshot is demonstrating the automatic TM search you get when clicking on any text flow. I think we need to provide an alternative mode for the highlighter, so that non-matching/missing text is hidden, matching text is highlighted, and added text is shown plain. It should just require a bit of CSS class tweaking, and a checkbox to turn it on and off.
highlighting search term only make sense when there is 100% match. If it's not, i.e. fuzzy search, how do we want to highlight? Picking out matching words?
Ok got the meaning. Basically we just use diff result.
Created attachment 654812 [details] Current diff can not cope with fuzzy search See attachment. Search term: Fedora is an open Item number three: Visit the Fedora community Wiki at <ulink url="http://fedoraproject.org/wiki/" />. Entire string is showing as missing(diff delete) and added(diff insert). There is no diff equal. Back to the question I asked in Comment 4
I don't think we want to make a big thing of this RFE. Just highlight the matching bits, according to diffmatchpatch, hide the missing bits, and show the added bits unhighlighted. Some edge cases may not highlight well, but they may not be worth worrying about. If we really wanted to, we could tell diffmatchpatch not to do "semantic cleanup" (see org.zanata.webtrans.client.ui.Highlighting.diff(String, String)), but this will probably make the highlighting uglier in most cases. I suppose it could be useful to turn off semantic cleanup only in the cases where it makes a complete mess (eg one big deletion, and one big insertion). But it's probably not worth the effort. Or you could try turning off semantic cleanup whenever term highlighting is active, and we could see if we like the results.
Turning semantic cleanup off when doing match term highlight. Semantic cleanup is on in normal diff mode. committed into master: https://github.com/zanata/zanata/commit/4b1d06485090490c8bd297f1d67ffbd8db5601ad
According to Hedda adding a user option that can be persisted is helpful
committed again into master: https://github.com/zanata/zanata/commit/83974ebe0a822173bd6d464df691a08a74e7ce09
VERIFIED with Zanata version 2.1-SNAPSHOT (20121206-1113)