Package org.omegat.filters2.html2
Class HTMLOptions
- java.lang.Object
-
- org.omegat.filters2.AbstractOptions
-
- org.omegat.filters2.html2.HTMLOptions
-
public class HTMLOptions extends AbstractOptions
Options for (X)HTML filter. Serializable to allow saving to / reading from configuration file.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 Modifier and Type Field Description static java.lang.StringOPTION_COMPRESS_WHITESPACEstatic java.lang.StringOPTION_IGNORE_TAGSstatic java.lang.StringOPTION_PARAGRAPH_ONBRstatic java.lang.StringOPTION_REMOVE_COMMENTSstatic java.lang.StringOPTION_REWRITE_ENCODINGstatic java.lang.StringOPTION_SKIP_METAstatic java.lang.StringOPTION_SKIP_REGEXPstatic java.lang.StringOPTION_TRANSLATE_BUTTONVALUEstatic java.lang.StringOPTION_TRANSLATE_HREFstatic java.lang.StringOPTION_TRANSLATE_HREFLANGstatic java.lang.StringOPTION_TRANSLATE_LANGstatic java.lang.StringOPTION_TRANSLATE_SRCstatic java.lang.StringOPTION_TRANSLATE_VALUE
-
Constructor Summary
Constructors Constructor Description HTMLOptions(java.util.Map<java.lang.String,java.lang.String> options)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleangetCompressWhitespace()java.lang.StringgetIgnoreTags()booleangetParagraphOnBr()Returns whether a new paragraph should be started on BR.booleangetRemoveComments()org.omegat.filters2.html2.HTMLOptions.REWRITE_MODEgetRewriteEncoding()Returns whether and when (X)HTML filter adds/rewrites encoding declaration.java.lang.StringgetSkipMeta()Returns the meta-tag attribute key-value pairs of which meta-tags should not be translatedjava.lang.StringgetSkipRegExp()Returns the regular expression that matches text not to be translatedbooleangetTranslateButtonValue()Returns whether button value attributes should be translated.booleangetTranslateHref()Returns whether href attributes should be translated.booleangetTranslateHreflang()Returns whether hreflang attributes should be translated.booleangetTranslateLang()Returns whether lang attributes should be translated.booleangetTranslateSrc()Returns whether src attributes should be translated.booleangetTranslateValue()Returns whether value attributes should be translated.voidsetCompressWhitespace(boolean compressWhitespace)Sets whether whitespace should be compressed in the HTML document on generating target documents.voidsetIgnoreTags(java.lang.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 the comments should be removed from the HTML document on generating target documents.voidsetRewriteEncoding(org.omegat.filters2.html2.HTMLOptions.REWRITE_MODE rewriteEncoding)Sets when (X)HTML filter should add/rewrite encoding declaration.voidsetSkipMeta(java.lang.String skipMeta)Sets the meta-tag attribute key-value pairs of which meta-tags should not be translatedvoidsetSkipRegExp(java.lang.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 Detail
-
OPTION_REWRITE_ENCODING
public static final java.lang.String OPTION_REWRITE_ENCODING
- See Also:
- Constant Field Values
-
OPTION_TRANSLATE_HREF
public static final java.lang.String OPTION_TRANSLATE_HREF
- See Also:
- Constant Field Values
-
OPTION_TRANSLATE_SRC
public static final java.lang.String OPTION_TRANSLATE_SRC
- See Also:
- Constant Field Values
-
OPTION_TRANSLATE_LANG
public static final java.lang.String OPTION_TRANSLATE_LANG
- See Also:
- Constant Field Values
-
OPTION_TRANSLATE_HREFLANG
public static final java.lang.String OPTION_TRANSLATE_HREFLANG
- See Also:
- Constant Field Values
-
OPTION_TRANSLATE_VALUE
public static final java.lang.String OPTION_TRANSLATE_VALUE
- See Also:
- Constant Field Values
-
OPTION_TRANSLATE_BUTTONVALUE
public static final java.lang.String OPTION_TRANSLATE_BUTTONVALUE
- See Also:
- Constant Field Values
-
OPTION_PARAGRAPH_ONBR
public static final java.lang.String OPTION_PARAGRAPH_ONBR
- See Also:
- Constant Field Values
-
OPTION_SKIP_REGEXP
public static final java.lang.String OPTION_SKIP_REGEXP
- See Also:
- Constant Field Values
-
OPTION_SKIP_META
public static final java.lang.String OPTION_SKIP_META
- See Also:
- Constant Field Values
-
OPTION_IGNORE_TAGS
public static final java.lang.String OPTION_IGNORE_TAGS
- See Also:
- Constant Field Values
-
OPTION_REMOVE_COMMENTS
public static final java.lang.String OPTION_REMOVE_COMMENTS
- See Also:
- Constant Field Values
-
OPTION_COMPRESS_WHITESPACE
public static final java.lang.String OPTION_COMPRESS_WHITESPACE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getRewriteEncoding
public org.omegat.filters2.html2.HTMLOptions.REWRITE_MODE getRewriteEncoding()
Returns whether and when (X)HTML filter adds/rewrites encoding declaration.- Returns:
- One of
HTMLOptions.REWRITE_MODE.ALWAYS,HTMLOptions.REWRITE_MODE.IFHEADER,HTMLOptions.REWRITE_MODE.IFMETA,HTMLOptions.REWRITE_MODE.NEVER.
-
setRewriteEncoding
public void setRewriteEncoding(org.omegat.filters2.html2.HTMLOptions.REWRITE_MODE rewriteEncoding)
Sets when (X)HTML filter should add/rewrite encoding declaration.- Parameters:
rewriteEncoding- One ofHTMLOptions.REWRITE_MODE.ALWAYS,HTMLOptions.REWRITE_MODE.IFHEADER,HTMLOptions.REWRITE_MODE.IFMETA,HTMLOptions.REWRITE_MODE.NEVER.
-
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
public java.lang.String getSkipRegExp()
Returns the regular expression that matches text not to be translated
-
setSkipRegExp
public void setSkipRegExp(java.lang.String skipRegExp)
Sets the regular expression that matches text not to be translated
-
getSkipMeta
public java.lang.String getSkipMeta()
Returns the meta-tag attribute key-value pairs of which meta-tags should not be translated
-
setSkipMeta
public void setSkipMeta(java.lang.String skipMeta)
Sets the meta-tag attribute key-value pairs of which meta-tags should not be translated
-
getIgnoreTags
public java.lang.String getIgnoreTags()
- Returns:
- the attribute key-value pairs for which tags should not be translated
-
setIgnoreTags
public void setIgnoreTags(java.lang.String ignoreTags)
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()
- Returns:
- Returns whether comments should be removed from the HTML document on generating target documents.
-
setRemoveComments
public void setRemoveComments(boolean removeComments)
Sets whether the comments should be removed from the HTML document on generating target documents.- Parameters:
removeComments-
-
getCompressWhitespace
public boolean getCompressWhitespace()
- Returns:
- Returns whether whitespace should be compressed in the HTML document on generating target documents.
-
setCompressWhitespace
public void setCompressWhitespace(boolean compressWhitespace)
Sets whether whitespace should be compressed in the HTML document on generating target documents.- Parameters:
compressWhitespace-
-
-