Class ResXFilter

All Implemented Interfaces:
IFilter, Translator

@NullMarked public class ResXFilter extends XMLFilter
Filter for ResX files.
  • Constructor Details

    • ResXFilter

      public ResXFilter()
      Creates a new instance of ResXFilter
  • Method Details

    • loadPlugins

      public static void loadPlugins()
      Register plugin into OmegaT.
    • unloadPlugins

      public static void unloadPlugins()
    • getFileFormatName

      public String getFileFormatName()
      Human-readable name of the File Format this filter supports.
      Specified by:
      getFileFormatName in interface IFilter
      Specified by:
      getFileFormatName in class AbstractFilter
      Returns:
      File format name
    • getDefaultInstances

      public Instance[] getDefaultInstances()
      The default list of filter instances that this filter class has. One filter class may have different filter instances, different by source file mask, encoding of the source file etc.

      There is one pattern for when no source language or source culture are present in the filename, one for when only a source language is present and one for when both source language and source culture are present. In all three cases, the source language and/or source culture are eaten from the filename, assuming the source language/culture use '.' (dot) as the separator.

      Note that the user may change the instances freely.

      Specified by:
      getDefaultInstances in interface IFilter
      Specified by:
      getDefaultInstances in class AbstractFilter
      Returns:
      Default filter instances
    • isSourceEncodingVariable

      public boolean isSourceEncodingVariable()
      Either the encoding can be read, or it is UTF-8.
      Specified by:
      isSourceEncodingVariable in interface IFilter
      Overrides:
      isSourceEncodingVariable in class XMLFilter
      Returns:
      false
    • isTargetEncodingVariable

      public boolean isTargetEncodingVariable()
      Yes, ResX may be written out in a variety of encodings.
      Specified by:
      isTargetEncodingVariable in interface IFilter
      Overrides:
      isTargetEncodingVariable in class XMLFilter
      Returns:
      true
    • tagStart

      public void tagStart(String path, @Nullable Attributes atts)
      Description copied from interface: Translator
      Start tag translation.
      Specified by:
      tagStart in interface Translator
      Overrides:
      tagStart in class XMLFilter
      Parameters:
      path - path in the XML
      atts - attributes
    • tagEnd

      public void tagEnd(String path)
      Description copied from interface: Translator
      Finish tag translation.
      Specified by:
      tagEnd in interface Translator
      Overrides:
      tagEnd in class XMLFilter
      Parameters:
      path - path in the XML
    • text

      public void text(@Nullable String newText)
      Description copied from interface: Translator
      Process text.
      Specified by:
      text in interface Translator
      Overrides:
      text in class XMLFilter
    • translate

      public String translate(String entry, @Nullable List<ProtectedPart> protectedParts)
      Description copied from class: XMLFilter
      The method the Handler would call to pass translatable content to OmegaT core and receive translation.
      Specified by:
      translate in interface Translator
      Overrides:
      translate in class XMLFilter