Package org.omegat.filters3.xml
Interface Translator
- All Known Implementing Classes:
AndroidFilter,CamtasiaWindowsFilter,DocBookFilter,FlashFilter,HelpAndManualFilter,InfixFilter,L10nmgrFilter,OpenDocXMLFilter,OpenXMLXMLFilter,PropertiesFilter,RelaxNGFilter,ResXFilter,SchematronFilter,ScribusFilter,SvgFilter,TXMLFilter,Typo3Filter,VisioFilter,WiXFilter,WordpressFilter,XHTMLFilter,XLIFFFilter,XMLFilter,XMLSpreadsheetFilter
public interface Translator
The interface to specify the method a Handler can use to translate text.
-
Method Summary
Modifier and TypeMethodDescriptionvoidProcess comment.createReader(File inFile, String inEncoding) Creates a special XML-encoding-aware reader of an input file.createWriter(@Nullable File outFile, String outEncoding) Creates a writer of the translated file.@Nullable Language@Nullable LanguagebooleanReturns true if the current section should be ignored by parser.voidFinish tag translation.voidtagStart(String path, @Nullable Attributes atts) Start tag translation.voidProcess text.translate(String s, @Nullable List<ProtectedPart> protectedParts) The method the Handler would call to pass translatable content to OmegaT core and receive translation.
-
Method Details
-
translate
The method the Handler would call to pass translatable content to OmegaT core and receive translation. -
createReader
BufferedReader createReader(File inFile, String inEncoding) throws UnsupportedEncodingException, IOException Creates a special XML-encoding-aware reader of an input file.- Parameters:
inFile- The source file.inEncoding- Encoding of the source file, if the filter supports it. Otherwise, it should be null.- Returns:
- The reader of the source file.
- Throws:
UnsupportedEncodingException- Thrown if JVM doesn't support the specified inEncoding.IOException- If I/O Error occurs upon reader creation.
-
createWriter
BufferedWriter createWriter(@Nullable @Nullable File outFile, String outEncoding) throws UnsupportedEncodingException, IOException Creates a writer of the translated file.- Parameters:
outFile- The target file.outEncoding- Encoding of the target file, if the filter supports it. Otherwise, it should be null.- Returns:
- The writer for the target file.
- Throws:
UnsupportedEncodingException- Thrown if JVM doesn't support the specified outEncodingIOException- If any I/O Error occurs upon writer creation
-
tagStart
Start tag translation.- Parameters:
path- path in the XMLatts- attributes
-
tagEnd
Finish tag translation.- Parameters:
path- path in the XML
-
comment
Process comment. -
text
Process text. -
isInIgnored
boolean isInIgnored()Returns true if the current section should be ignored by parser. -
getTargetLanguage
-
getSourceLanguage
-