Table of Contents

Class XlfTransUnit

Namespace
SunamoXliffParser
Assembly
SunamoXliffParser.dll

Represents a translation unit (trans-unit) element in an XLIFF document.

public class XlfTransUnit
Inheritance
XlfTransUnit
Inherited Members
Extension Methods

Constructors

XlfTransUnit(XElement, XNamespace)

Initializes a new instance of the XlfTransUnit class from an existing XML element.

public XlfTransUnit(XElement node, XNamespace xmlNamespace)

Parameters

node XElement

The XML element representing the translation unit.

xmlNamespace XNamespace

The XML namespace of the XLIFF document.

XlfTransUnit(XElement, XNamespace, string, string, string)

Initializes a new instance of the XlfTransUnit class with specified values.

public XlfTransUnit(XElement node, XNamespace xmlNamespace, string id, string source, string target)

Parameters

node XElement

The XML element representing the translation unit.

xmlNamespace XNamespace

The XML namespace of the XLIFF document.

id string

The identifier of the translation unit.

source string

The source text.

target string

The target text.

Fields

ResxPrefix

The prefix used for resource identifiers in the Multilingual App Toolkit dialect.

public const string ResxPrefix = "Resx/"

Field Value

string

Properties

Id

Gets the identifier of this translation unit.

public string Id { get; }

Property Value

string

Optional

Gets the optional attributes of this translation unit.

public XlfTransUnit.Optionals Optional { get; }

Property Value

XlfTransUnit.Optionals

Source

Gets or sets the source text of this translation unit.

public string Source { get; set; }

Property Value

string

Target

Gets or sets the value of the target element. May be null if the element does not exist. Allowed are zero or one target elements.

public string? Target { get; set; }

Property Value

string

Methods

GetId(XlfDialect)

Gets the effective identifier for this translation unit based on the specified dialect.

public string GetId(XlfDialect dialect)

Parameters

dialect XlfDialect

The XLIFF dialect to use for identifier resolution.

Returns

string

The resolved identifier string.