Package org.omegat.core.data
Class TranslateEntry
- java.lang.Object
-
- org.omegat.core.data.TranslateEntry
-
- All Implemented Interfaces:
ITranslateCallback
public abstract class TranslateEntry extends java.lang.Object implements 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 Constructor Description TranslateEntry(ProjectProperties config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getTranslation(java.lang.String id, java.lang.String origSource)
Old call without path, for compatibilityjava.lang.String
getTranslation(java.lang.String id, java.lang.String origSource, java.lang.String path)
Get translation for output to compiled target.void
linkPrevNextSegments()
This method called from AbstractFilter if filter require second pass.void
setPass(int pass)
Set current pass number Any filter called in one-pass mode by default.
-
-
-
Constructor Detail
-
TranslateEntry
public TranslateEntry(ProjectProperties config)
-
-
Method Detail
-
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:
setPass
in interfaceITranslateCallback
- Parameters:
pass
- The current path number, i.e., 1 or 2
-
getTranslation
public java.lang.String getTranslation(java.lang.String id, java.lang.String origSource, java.lang.String path)
Get translation for output to compiled target.- Specified by:
getTranslation
in 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
public java.lang.String getTranslation(java.lang.String id, java.lang.String origSource)
Old call without path, for compatibility- Specified by:
getTranslation
in 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:
linkPrevNextSegments
in interfaceITranslateCallback
-
-