From: Didier B. <d....@fr...> - 2010-07-01 17:41:53
|
-----Original Message----- >From: Alexander Becker [mailto:Ale...@gm...] >Sent: Wednesday, June 30, 2010 4:45 PM >To: 'Mailing list for OmegaT developers.' >Subject: Re: [OmTdev] How to apply a filter to an input file >I'm really sorry, but I don't find the part of the code in the filter, where >the segment, that will be compared with the translation memory, is formed. Probably because it isn't there. >I'm able to output the segments as they come in when reading a file, but >these segment still contain the markup. I would like to use the string, that >is presented in the OmegaT user interface when translating. > >I guess it's somewhere in HTMLFilter2.java (org.omegat.filters2.html2), but >I don't get where :-s > >Can someone help me find it? You won't find it in the HTML filter (or in any filter). What you find in a filter is the source text read and the target text written. In between, there is the text presented to the translator. You will get closer to what you want (and that will work with any filter), if you look at processEntry(). If you look at the XtagFilter, the process is rather explicit: /** * Processes Xtags before and after sending the entry to OmegaT. * The Xtags in the entry are converted to OmegaT tags, then the entry * is sent to OmegaT, and the OmegaT tags are converted back to Xtags. * @param entry An entry to process * @return The entry for the target document */ private String privateProcessEntry(String entry) { entry = convertToTags(entry); entry = processEntry(entry); entry = convertToXtags(entry); return entry; } Didier |