Search Results for

    Show / Hide Table of Contents

    Class LocalizedString

    Represents a collection of culture-annotated strings.

    Inheritance
    System.Object
    LocalizedString
    Implements
    System.Collections.Generic.IEnumerable<CultureString>
    System.Collections.IEnumerable
    System.ICloneable
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: Sdl.LanguagePlatform.Core.Segmentation
    Assembly: Sdl.LanguagePlatform.Core.dll
    Syntax
    public class LocalizedString : IEnumerable<CultureString>, IEnumerable, ICloneable

    Constructors

    LocalizedString()

    Initializes a new instance with default values.

    Declaration
    public LocalizedString()

    LocalizedString(LocalizedString)

    Initializes a new instance with the values of another instance, creating a deep copy.

    Declaration
    public LocalizedString(LocalizedString other)
    Parameters
    Type Name Description
    LocalizedString other

    The other instance

    LocalizedString(String)

    Creates a new instance with the InvariantText set to the provided text.

    Declaration
    public LocalizedString(string text)
    Parameters
    Type Name Description
    System.String text

    The text to use for the invariant culture

    Properties

    Count

    Returns the number of localized versions of the string.

    Declaration
    public int Count { get; }
    Property Value
    Type Description
    System.Int32

    InvariantText

    Accesses the localized text which is compatible with the invariant culture.

    Declaration
    public string InvariantText { get; set; }
    Property Value
    Type Description
    System.String

    Text

    Accesses the localized text which is compatible with the current UI culture.

    Declaration
    public string Text { get; set; }
    Property Value
    Type Description
    System.String

    Methods

    Add(Object)

    Only used for XML deserialization.

    Declaration
    public void Add(object o)
    Parameters
    Type Name Description
    System.Object o

    Clone()

    System.ICloneable.Clone()
    Declaration
    public object Clone()
    Returns
    Type Description
    System.Object

    A new object that is a deep copy of this instance.

    DeleteText(CultureInfo)

    Deletes the text compatible with the provided culture.

    Declaration
    public void DeleteText(CultureInfo culture)
    Parameters
    Type Name Description
    System.Globalization.CultureInfo culture

    The culture

    DeleteText(CultureInfo, Boolean)

    Deletes the text for the provided culture.

    Declaration
    public void DeleteText(CultureInfo culture, bool mayFallback)
    Parameters
    Type Name Description
    System.Globalization.CultureInfo culture

    The culture

    System.Boolean mayFallback

    If false, the culture of the text and the provided culture must match exactly. Otherwise, it is sufficient if the cultures are compatible. If an exact match for the culture is available, it will still be preferred.

    GetEnumerator()

    Returns an enumerator which is used to enumerate the encapsulated culture-annotated strings.

    Declaration
    public IEnumerator<CultureString> GetEnumerator()
    Returns
    Type Description
    System.Collections.Generic.IEnumerator<CultureString>

    An enumerator

    GetText(CultureInfo)

    Returns the text compatible with the provided culture.

    Declaration
    public string GetText(CultureInfo culture)
    Parameters
    Type Name Description
    System.Globalization.CultureInfo culture
    Returns
    Type Description
    System.String

    GetText(CultureInfo, Boolean)

    Returns the text for the provided culture.

    Declaration
    public string GetText(CultureInfo culture, bool mayFallback)
    Parameters
    Type Name Description
    System.Globalization.CultureInfo culture

    The culture (non-null)

    System.Boolean mayFallback

    If false, the culture of the text and the provided culture must match exactly. Otherwise, it is sufficient if the cultures are compatible. If an exact match for the culture is available, it will still be preferred.

    Returns
    Type Description
    System.String

    SetText(CultureInfo, String)

    Sets (adds or overwrites) the text compatible with the provided culture.

    Declaration
    public void SetText(CultureInfo culture, string text)
    Parameters
    Type Name Description
    System.Globalization.CultureInfo culture

    The culture (non-null)

    System.String text

    The text

    SetText(CultureInfo, String, Boolean)

    Sets the text for the provided culture.

    Declaration
    public void SetText(CultureInfo culture, string text, bool mayFallback)
    Parameters
    Type Name Description
    System.Globalization.CultureInfo culture

    The culture (non-null)

    System.String text

    The text

    System.Boolean mayFallback

    If false, the culture of the text and the provided culture must match exactly. Otherwise, it is sufficient if the cultures are compatible. If an exact match for the culture is available, it will still be preferred.

    ToString()

    System.Object.ToString()
    Declaration
    public override string ToString()
    Returns
    Type Description
    System.String

    A string representation of the object, for display purposes.

    Overrides
    System.Object.ToString()

    Explicit Interface Implementations

    IEnumerable.GetEnumerator()

    System.Collections.IEnumerable.GetEnumerator()
    Declaration
    IEnumerator IEnumerable.GetEnumerator()
    Returns
    Type Description
    System.Collections.IEnumerator

    Implements

    System.Collections.Generic.IEnumerable<T>
    System.Collections.IEnumerable
    System.ICloneable

    On this page

    • Constructors
      • LocalizedString()
      • LocalizedString(LocalizedString)
      • LocalizedString(String)
    • Properties
      • Count
      • InvariantText
      • Text
    • Methods
      • Add(Object)
      • Clone()
      • DeleteText(CultureInfo)
      • DeleteText(CultureInfo, Boolean)
      • GetEnumerator()
      • GetText(CultureInfo)
      • GetText(CultureInfo, Boolean)
      • SetText(CultureInfo, String)
      • SetText(CultureInfo, String, Boolean)
      • ToString()
    • Explicit Interface Implementations
      • IEnumerable.GetEnumerator()
    • Implements
    Back to top Generated by DocFX