Package org.omegat.core.data
Class TranslateEntry
java.lang.Object
org.omegat.core.data.TranslateEntry
- All Implemented Interfaces:
ITranslateCallback
Base class for entry translation.
This class collects all segments which should be translated, for ability to link prev/next segments for the
seconds pass.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetTranslation(String id, String origSource) Old call without path, for compatibilitygetTranslation(String id, String origSource, String path) Get translation for output to compiled target.voidThis method called from AbstractFilter if filter require second pass.voidsetPass(int pass) Set current pass number.
-
Constructor Details
-
TranslateEntry
-
-
Method Details
-
setPass
public void setPass(int pass) Set current pass number.Any filter called in one-pass mode by default. But if it require second pass for support prev/next segments, it can set flag 'needSecondPass'.
- Specified by:
setPassin interfaceITranslateCallback- Parameters:
pass- The current path number, i.e., 1 or 2
-
getTranslation
Get translation for output to compiled target.- Specified by:
getTranslationin interfaceITranslateCallback- Parameters:
id- ID in source file, or null if ID not supported by formatorigSource- source entry textpath- path of segment- Returns:
- translation or null if translation not exist
-
getTranslation
Old call without path, for compatibility- Specified by:
getTranslationin interfaceITranslateCallback- Parameters:
id- ID in source file, or null if ID not supported by formatorigSource- source entry text- Returns:
- translation or null if translation not exist
-
linkPrevNextSegments
public void linkPrevNextSegments()This method called from AbstractFilter if filter require second pass. It links prev/next segments for multiple translations.- Specified by:
linkPrevNextSegmentsin interfaceITranslateCallback
-