Click or drag to resize
TranslationUnit Class
Represents a pair of source and target text, decorated with a set of system fields and eventually, with a set of user defined fields/attributes. It may also contain contextual information as well as information about its origin and eventually, a key for unique identification on a given system.
Inheritance Hierarchy

Namespace: Sdl.LanguagePlatform.TranslationMemory
Assembly: Sdl.LanguagePlatform.TranslationMemory (in Sdl.LanguagePlatform.TranslationMemory.dll) Version: 1.6.0.0 (1.7.3662.0)
Syntax
public class TranslationUnit : PersistentObject, 
	ITypedKeyValueContainer

The TranslationUnit type exposes the following members.

Constructors
  NameDescription
Public methodTranslationUnit
Initializes a new instance of the TranslationUnit class. The system fields are initialized to their default values, the user defined fields as well as the context list are initialized to empty lists.
Public methodTranslationUnit(TranslationUnit)
Initializes a new instance of the TranslationUnit class from another instance (deep copy).
Public methodTranslationUnit(Segment, Segment)
Initializes a new instance of the TranslationUnit class with the specified values. The system fields are initialized to their default values, the user defined fields as well as the context list are initialized to empty lists.
Top
Properties
  NameDescription
Public propertyConfirmationLevel
Gets or sets the confirmation level of this translation unit.
Public propertyContexts
Gets or sets the contexts for this instance.
Public propertyDocumentProperties
Gets or set the document properties
Public propertyDocumentSegmentPair
Gets or sets the segment pair associated to this translation unit. The segment pair should not be modified because the modification might change the original document.
Public propertyFieldValues
Gets or sets the user-defined field values for this translation unit.
Public propertyFileProperties
Gets or set the file properties
Public propertyFormat
Gets or sets the format of this translation unit.
Public propertyOrigin
Gets or sets the origin of this translation unit.
Public propertyResourceId
Gets or sets the resource ID for this object.
(Inherited from PersistentObject.)
Public propertySourceSegment
Gets or sets the source segment of this instance.
Public propertyStructureContexts
Gets or sets the names of the structure contexts in which this translation unit occured within the documents it originated from.
Public propertySystemFields
Gets or sets the system fields of this translation unit.
Public propertyTargetSegment
Gets or sets the target segment of this instance.
Top
Methods
  NameDescription
Public methodCheckAndComputeTagAssociations
Computes cross-segment tag associations. Primarily checks or changes the tag-related alignment anchors. Renumbers association anchors.
Public methodComputePlaceables
Computes the list of placeables and their alignment for this translation unit.
Public methodDeleteTags
Deletes all tags from the TU's segments but keeps text placeholders (and locked content tags).
Public methodDeleteTags(SegmentDeleteTagsAction)
Deletes all tags from the TU's segments and performs the specified SegmentDeleteTagsAction on text placeholders and locked content.
Public methodDuplicate
Instantiates and returns a deep copy of the current instance.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetMaxTagAnchor
Returns the highest tag anchor used in any segment, or 0 if no tags are present.
Public methodStatic memberGetSystemFieldType
Returns the field value type for known system and pseudo fields.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodGetType(String)
Retrieves the type of the specified field.
Public methodGetValue(String)
Retrieves the value of a specified field from this translation unit.

The system fields can be retrieved using the following names:

NameCorresponding System Field
chdChange date
chuChange user
usdLast used date
usuLast used user
uscUsage counter
crdCreation date
cruCreation user

Pseudo-fields contain values that are not saved as separate field values, but can be computed from the existing information in a translatin unit. The available pseudo-fields are:

NameCorresponding Pseudo-field
srcSource segment (including tags).
trgTarget segment (including tags)
sourceplainlengthThe length of the plain text in the source segment (without tags)
targetplainlengthThe length of the plain text in the target segment (without tags)
Public methodGetValue(String, FieldValueType)
Retrieves the field value with the specified type from this translation unit.
Public methodIsValid
Determines whether this instance is a valid translation unit.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodSetValue
Sets the value of the specified field, which can be a system field or a user field. Pseudo fields (such as src, trg, soruceplainlength, etc.) can not be set.

Exceptions will be thrown if the field types are incompatible.

Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodTrim
Trims off peripheral whitespace from the TU's segments.
Public methodValidate
Performs validation checks on this instance. All errors will be reported.
Public methodValidate(SegmentValidationMode)
Performs validation checks on this instance with the specified validation mode.
Top
See Also
Community
Edit

Be the first to Edit the community content of this topic.
Comments