Table of Contents

Class XlfTransUnit.Optionals

Namespace
SunamoXliffParser
Assembly
SunamoXliffParser.dll

Provides access to optional attributes of a translation unit element.

public class XlfTransUnit.Optionals
Inheritance
XlfTransUnit.Optionals
Inherited Members
Extension Methods

Constructors

Optionals(XElement, XNamespace)

Initializes a new instance of the XlfTransUnit.Optionals class.

public Optionals(XElement node, XNamespace xmlNamespace)

Parameters

node XElement

The XML element containing optional attributes.

xmlNamespace XNamespace

The XML namespace of the XLIFF document.

Properties

Approved

Gets or sets the approved attribute which indicates whether a translation is final or has passed its final review.

public string Approved { get; set; }

Property Value

string

DataType

Gets or sets the datatype attribute specifying the kind of text contained in the element.

public string DataType { get; set; }

Property Value

string

Notes

Gets the collection of note elements associated with this translation unit.

public IEnumerable<XlfNote> Notes { get; }

Property Value

IEnumerable<XlfNote>

Resname

Gets or sets the resname attribute which is the resource name or identifier of an item.

public string Resname { get; set; }

Property Value

string

Restype

Gets or sets the restype attribute which indicates the resource type of the container element.

public string Restype { get; set; }

Property Value

string

TargetState

Gets or sets the status of a particular translation in a target or bin-target element.

public string? TargetState { get; set; }

Property Value

string

Translate

Gets or sets the translate attribute which indicates whether or not the text should be translated.

public string Translate { get; set; }

Property Value

string

Methods

AddNote(string)

Adds a note with the specified comment.

public void AddNote(string comment)

Parameters

comment string

The text content of the note.

AddNote(string, string)

Adds a note with the specified comment and optional author.

public void AddNote(string comment, string from)

Parameters

comment string

The text content of the note.

from string

The author of the note.

RemoveNotes(string, string)

Removes all notes that have the specified attribute with the specified value.

public void RemoveNotes(string attributeName, string value)

Parameters

attributeName string

The name of the attribute to match.

value string

The value of the attribute to match.

SetCommentFromResx(string)

Sets or updates the first note from a ResX comment, or adds a new note if none exists.

public void SetCommentFromResx(string comment)

Parameters

comment string

The comment text from the ResX source.

ToString()

Returns the XML string representation of this translation unit's optional attributes.

public override string ToString()

Returns

string

The XML string of the node.