Interface ITranslateCallback

All Known Implementing Classes:
TranslateEntry

public interface ITranslateCallback
Callback for translate files.
  • Method Summary

    Modifier and Type
    Method
    Description
    @Nullable String
    getTranslation(@Nullable String id, String source)
    Old call without path, for compatibility
    @Nullable String
    getTranslation(@Nullable String id, String source, @Nullable String path)
    Get translation for output to compiled target.
    void
    This method called from AbstractFilter if filter require second pass.
    void
    setPass(int pass)
    Set current pass number.
  • Method Details

    • setPass

      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'.

      Parameters:
      pass - The current path number, i.e., 1 or 2
    • linkPrevNextSegments

      void linkPrevNextSegments()
      This method called from AbstractFilter if filter require second pass. It links prev/next segments for multiple translations.
    • getTranslation

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

      @Nullable String getTranslation(@Nullable String id, String source)
      Old call without path, for compatibility
      Parameters:
      id - ID in source file, or null if ID not supported by format
      source - source entry text
      Returns:
      translation or null if translation not exist