Class TranslateEntry

java.lang.Object
org.omegat.core.data.TranslateEntry
All Implemented Interfaces:
ITranslateCallback

public abstract class TranslateEntry extends 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 Details

  • 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:
      setPass in interface ITranslateCallback
      Parameters:
      pass - The current path number, i.e., 1 or 2
    • getTranslation

      public String getTranslation(String id, String origSource, String path)
      Get translation for output to compiled target.
      Specified by:
      getTranslation in interface ITranslateCallback
      Parameters:
      id - ID in source file, or null if ID not supported by format
      origSource - source entry text
      path - path of segment
      Returns:
      translation or null if translation not exist
    • getTranslation

      public String getTranslation(String id, String origSource)
      Old call without path, for compatibility
      Specified by:
      getTranslation in interface ITranslateCallback
      Parameters:
      id - ID in source file, or null if ID not supported by format
      origSource - 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 interface ITranslateCallback