Package org.omegat.filters3.xml.xliff
Class XLIFFDialect
java.lang.Object
org.omegat.filters3.xml.DefaultXMLDialect
org.omegat.filters3.xml.xliff.XLIFFDialect
- All Implemented Interfaces:
XMLDialect
This class specifies XLIFF XML Dialect.
-
Field Summary
Fields inherited from interface org.omegat.filters3.xml.XMLDialect
CONSTRAINT_DOCTYPE, CONSTRAINT_DOCTYPE_UNBOXED, CONSTRAINT_PUBLIC_DOCTYPE, CONSTRAINT_PUBLIC_DOCTYPE_UNBOXED, CONSTRAINT_ROOT, CONSTRAINT_ROOT_UNBOXED, CONSTRAINT_SYSTEM_DOCTYPE, CONSTRAINT_SYSTEM_DOCTYPE_UNBOXED, CONSTRAINT_XMLNS, CONSTRAINT_XMLNS_UNBOXED -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconstructShortcuts(List<Element> elements, List<ProtectedPart> protectedParts) Returns shortcut string representation of the entry source.voiddefineDialect(XLIFFOptions options) Actually defines the dialect.voidhandleXMLTag(XMLTag tag, boolean translated) Handle <target state="..."> attribute according to filter settings.validateContentBasedTag(String tag, @Nullable Attributes atts) For a given tag, return wether the content of this tag should be translated, depending on the content of one attribute and the presence or absence of other attributes.validateIntactTag(String tag, @Nullable Attributes atts) In the XLKIFF filter, content shouldn't be translated if translate="no" translate attributevalidatePreformatTag(String tag, @Nullable Attributes atts) In the XLIFF filter, the tag <mrk> is a preformat tag when the attribute "mtype" contains "seg".Methods inherited from class org.omegat.filters3.xml.DefaultXMLDialect
defineConstraint, defineContentBasedTag, defineIntactTag, defineIntactTags, defineOutOfTurnTag, defineOutOfTurnTags, defineParagraphTag, defineParagraphTags, definePreformatTag, definePreformatTags, defineShortcut, defineShortcuts, defineTranslatableAttribute, defineTranslatableAttributes, defineTranslatableTagAttribute, defineTranslatableTagAttributes, defineTranslatableTagsAttribute, getClosingTagRequired, getConstraints, getContentBasedTags, getForceSpacePreserving, getIntactTags, getOutOfTurnTags, getParagraphTags, getPreformatTags, getShortcuts, getTagsAggregationEnabled, getTranslatableAttributes, getTranslatableTagAttributes, resolveEntity, setClosingTagRequired, setForceSpacePreserving, setTagsAggregationEnabled, validateParagraphTag, validateTranslatableTag, validateTranslatableTagAttribute
-
Constructor Details
-
XLIFFDialect
public XLIFFDialect()
-
-
Method Details
-
defineDialect
Actually defines the dialect. It cannot be done during creation, because options are not known at that step. -
validatePreformatTag
In the XLIFF filter, the tag <mrk> is a preformat tag when the attribute "mtype" contains "seg".- Specified by:
validatePreformatTagin interfaceXMLDialect- Overrides:
validatePreformatTagin classDefaultXMLDialect- Parameters:
tag- An XML tagatts- The attributes associated with the tag- Returns:
trueif this tag should be a preformat tag,falseotherwise
-
validateIntactTag
In the XLKIFF filter, content shouldn't be translated if translate="no" translate attribute- Specified by:
validateIntactTagin interfaceXMLDialect- Overrides:
validateIntactTagin classDefaultXMLDialect- Parameters:
tag- An XML tagatts- The attributes associated with the tag- Returns:
falseif the content of this tag should be translated,trueotherwise
-
validateContentBasedTag
Description copied from interface:XMLDialectFor a given tag, return wether the content of this tag should be translated, depending on the content of one attribute and the presence or absence of other attributes.- Specified by:
validateContentBasedTagin interfaceXMLDialect- Overrides:
validateContentBasedTagin classDefaultXMLDialect- Parameters:
tag- The tag that could be translatedatts- The list of the tag attributes- Returns:
trueorfalse
-
handleXMLTag
Handle <target state="..."> attribute according to filter settings.- Specified by:
handleXMLTagin interfaceXMLDialect- Overrides:
handleXMLTagin classDefaultXMLDialect- Parameters:
tag- XML tag to be processed.translated- is the value considered translated?- See Also:
-
constructShortcuts
Description copied from interface:XMLDialectReturns shortcut string representation of the entry source. This is what the user translates. E.g. forHere's <b>bold text</b>should returnHere's <b0>bold text</b0>.- Specified by:
constructShortcutsin interfaceXMLDialect- Overrides:
constructShortcutsin classDefaultXMLDialect
-