Package org.omegat.filters2.html2
Class HTMLOptions
java.lang.Object
org.omegat.filters2.AbstractOptions
org.omegat.filters2.html2.HTMLOptions
Options for (X)HTML filter. Serializable to allow saving to / reading from
configuration file.
Skip text matching regExp []
Skip content of meta-tag when any of the given attibutename-value pairs is present in the tag Ignore tags matching regexp [] Consider the tag as untranslatable when any of the given attibutename-value pairs is present in the tag
HTML filter would have the following options ([+] means default on).
Add or rewrite encoding declaration in HTML and XHTML files:
- [] Always
- [+] Only if HTML file has a header
- [] Only if HTML file has an encoding declaration
- [] Never
- [+] href
- [+] src
- [+] lang
- [+] hreflang
- [+] value
- [+] value (of buttons)
Skip text matching regExp []
Skip content of meta-tag when any of the given attibutename-value pairs is present in the tag Ignore tags matching regexp [] Consider the tag as untranslatable when any of the given attibutename-value pairs is present in the tag
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanRetrieves the configuration setting that indicates whether whitespace should be compressed in the HTML document during processing.Retrieves the tags to be ignored during the processing of HTML content.booleanReturns whether a new paragraph should be started on BR.booleanRetrieves the configuration setting that indicates whether comments should be removed from the HTML document when generating target documents.Returns the meta-tag attribute key-value pairs of which meta-tags should not be translatedReturns the regular expression that matches text not to be translatedbooleanReturns whether button value attributes should be translated.booleanReturns whether href attributes should be translated.booleanReturns whether hreflang attributes should be translated.booleanReturns whether lang attributes should be translated.booleanReturns whether src attributes should be translated.booleanReturns whether value attributes should be translated.voidsetCompressWhitespace(boolean compressWhitespace) Sets whether whitespace in the HTML document should be compressed during processing.voidsetIgnoreTags(String ignoreTags) Sets the attribute key-value pairs for which tags should not be translatedvoidsetParagraphOnBr(boolean paragraphOnBr) Sets whether a new paragraph should be started on BR.voidsetRemoveComments(boolean removeComments) Sets whether comments should be removed from the HTML document when generating target documents.voidsetSkipMeta(String skipMeta) Sets the meta-tag attribute key-value pairs of which meta-tags should not be translatedvoidsetSkipRegExp(String skipRegExp) Sets the regular expression that matches text not to be translatedvoidsetTranslateButtonValue(boolean translateButtonValue) Sets whether button value attributes should be translated.voidsetTranslateHref(boolean translateHref) Sets whether href attributes should be translated.voidsetTranslateHreflang(boolean translateHreflang) Sets whether hreflang attributes should be translated.voidsetTranslateLang(boolean translateLang) Sets whether lang attributes should be translated.voidsetTranslateSrc(boolean translateSrc) Sets whether src attributes should be translated.voidsetTranslateValue(boolean translateValue) Sets whether value attributes should be translated.Methods inherited from class org.omegat.filters2.AbstractOptions
getOptionsMap
-
Field Details
-
OPTION_REWRITE_ENCODING
- See Also:
-
OPTION_TRANSLATE_HREF
- See Also:
-
OPTION_TRANSLATE_SRC
- See Also:
-
OPTION_TRANSLATE_LANG
- See Also:
-
OPTION_TRANSLATE_HREFLANG
- See Also:
-
OPTION_TRANSLATE_VALUE
- See Also:
-
OPTION_TRANSLATE_BUTTONVALUE
- See Also:
-
OPTION_PARAGRAPH_ONBR
- See Also:
-
OPTION_SKIP_REGEXP
- See Also:
-
OPTION_SKIP_META
- See Also:
-
OPTION_IGNORE_TAGS
- See Also:
-
OPTION_REMOVE_COMMENTS
- See Also:
-
OPTION_COMPRESS_WHITESPACE
- See Also:
-
-
Constructor Details
-
HTMLOptions
-
-
Method Details
-
getTranslateHref
public boolean getTranslateHref()Returns whether href attributes should be translated. -
setTranslateHref
public void setTranslateHref(boolean translateHref) Sets whether href attributes should be translated. -
getTranslateSrc
public boolean getTranslateSrc()Returns whether src attributes should be translated. -
setTranslateSrc
public void setTranslateSrc(boolean translateSrc) Sets whether src attributes should be translated. -
getTranslateLang
public boolean getTranslateLang()Returns whether lang attributes should be translated. -
setTranslateLang
public void setTranslateLang(boolean translateLang) Sets whether lang attributes should be translated. -
getTranslateHreflang
public boolean getTranslateHreflang()Returns whether hreflang attributes should be translated. -
setTranslateHreflang
public void setTranslateHreflang(boolean translateHreflang) Sets whether hreflang attributes should be translated. -
setTranslateValue
public void setTranslateValue(boolean translateValue) Sets whether value attributes should be translated. -
getTranslateValue
public boolean getTranslateValue()Returns whether value attributes should be translated. -
setTranslateButtonValue
public void setTranslateButtonValue(boolean translateButtonValue) Sets whether button value attributes should be translated. -
getTranslateButtonValue
public boolean getTranslateButtonValue()Returns whether button value attributes should be translated. -
getParagraphOnBr
public boolean getParagraphOnBr()Returns whether a new paragraph should be started on BR. -
setParagraphOnBr
public void setParagraphOnBr(boolean paragraphOnBr) Sets whether a new paragraph should be started on BR. -
getSkipRegExp
Returns the regular expression that matches text not to be translated -
setSkipRegExp
Sets the regular expression that matches text not to be translated -
getSkipMeta
Returns the meta-tag attribute key-value pairs of which meta-tags should not be translated -
setSkipMeta
Sets the meta-tag attribute key-value pairs of which meta-tags should not be translated -
getIgnoreTags
Retrieves the tags to be ignored during the processing of HTML content.- Returns:
- the attribute key-value pairs for which tags should not be translated
-
setIgnoreTags
Sets the attribute key-value pairs for which tags should not be translated- Parameters:
ignoreTags- The strings containing the key-value pairs
-
getRemoveComments
public boolean getRemoveComments()Retrieves the configuration setting that indicates whether comments should be removed from the HTML document when generating target documents.- Returns:
- Returns whether comments should be removed from the HTML document on generating target documents.
-
setRemoveComments
public void setRemoveComments(boolean removeComments) Sets whether comments should be removed from the HTML document when generating target documents.- Parameters:
removeComments- a boolean indicating whether comments should be removed from the HTML content
-
getCompressWhitespace
public boolean getCompressWhitespace()Retrieves the configuration setting that indicates whether whitespace should be compressed in the HTML document during processing.- Returns:
- Returns whether whitespace should be compressed in the HTML document on generating target documents.
-
setCompressWhitespace
public void setCompressWhitespace(boolean compressWhitespace) Sets whether whitespace in the HTML document should be compressed during processing. This affects how the output HTML is formatted by removing redundant whitespace.- Parameters:
compressWhitespace- a boolean indicating whether whitespace should be compressed
-