Search Results for

    Show / Hide Table of Contents

    Struct LegacyTradosLanguage

    Represents a project language in the client object model

    Implements
    System.Xml.Serialization.IXmlSerializable
    Inherited Members
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetType()
    Namespace: Sdl.Core.Globalization
    Assembly: Sdl.Core.Globalization.dll
    Syntax
    public struct LegacyTradosLanguage

    Constructors

    LegacyTradosLanguage(Int32)

    Construction from an LCID value. The LCID can be a valid Windows/.NET supported LCID, or a TRADOS defined "LCID", such as 2108 for Gaelic (Scotland).

    Declaration
    public LegacyTradosLanguage(int lcid)
    Parameters
    Type Name Description
    System.Int32 lcid

    Locale identifier of the locale to validate

    LegacyTradosLanguage(String)

    Construction from a 2 or 5 letter ISO code (i.e. with or without sublanguage/region). The 2 letter language code should be separated from the 2 letter country code with a dash. Examples: EN-US, DE-DE, SW-SE, JP

    Declaration
    public LegacyTradosLanguage(string isoCode)
    Parameters
    Type Name Description
    System.String isoCode

    the isoCode (e.g. en-us, de-de etc)

    Properties

    IsInstalled

    true if the language with this LCID is supported directly by the operating system.

    Declaration
    public readonly bool IsInstalled { get; }
    Property Value
    Type Description
    System.Boolean

    IsoCode

    The 5 letter ISO code corresponding to this language, in this format: EN-US, JP-JP, etc.

    May be empty if IsValid is false.

    Declaration
    public readonly string IsoCode { get; }
    Property Value
    Type Description
    System.String

    IsProprietary

    true if this LCID is a proprietary TRADOS "LCID".

    Declaration
    public readonly bool IsProprietary { get; }
    Property Value
    Type Description
    System.Boolean

    IsValid

    true if the language is a valid LCID and ISO language code.

    Declaration
    public readonly bool IsValid { get; }
    Property Value
    Type Description
    System.Boolean

    Lcid

    The Windows/.NET LCID for the language.

    May be 0 if IsValid is false.

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

    Methods

    Equals(Object)

    Compares two Language objects. If they are both valid and have the same LCID they are considered equal. If they are not valid they are considered equal if they have the same "ISO code".

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    System.Object obj

    the object to compare to

    Returns
    Type Description
    System.Boolean

    true if they are both of type LegacyTradosLanguage with the same Lcid and IsoCode

    Overrides
    System.ValueType.Equals(System.Object)

    GetAllLcids()

    Get all the possible Trados LCIDs from languages/locations known to TRADOS.

    Declaration
    public static int[] GetAllLcids()
    Returns
    Type Description
    System.Int32[]

    An array of LCIDs

    GetEnglishLanguageNameFromLcid()

    Returns the English language name of the locale.

    Declaration
    public string GetEnglishLanguageNameFromLcid()
    Returns
    Type Description
    System.String

    The English language name of the locale specified by Lcid

    Remarks

    This method also supports the TRADOS specific locales that are not otherwise supported by Windows and .NET.

    GetEnglishLanguageNameFromLcid(Int32)

    Returns the English language name of the locale specified by lcid.

    Declaration
    public static string GetEnglishLanguageNameFromLcid(int lcid)
    Parameters
    Type Name Description
    System.Int32 lcid

    An LCID

    Returns
    Type Description
    System.String

    The English language name of the locale specified by lcid

    Remarks

    This method also supports the TRADOS specific locales that are not otherwise supported by Windows and .NET.

    GetEnglishNameFromLcid(Int32)

    Returns the English language and region name of the locale specified by lcid.

    Declaration
    public static string GetEnglishNameFromLcid(int lcid)
    Parameters
    Type Name Description
    System.Int32 lcid

    An LCID

    Returns
    Type Description
    System.String

    The English language and region name of the locale specified by lcid

    Remarks

    This method also supports the TRADOS specific locales that are not otherwise supported by Windows and .NET.

    GetHashCode()

    Returns a hash code value for the Language object.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    System.Int32

    A hash code value for the Language object.

    Overrides
    System.ValueType.GetHashCode()

    GetIsoCodeFromLcid(Int32, Boolean)

    Converts between LCID and ISO language codes.

    Declaration
    public static string GetIsoCodeFromLcid(int lcid, bool includeCountry)
    Parameters
    Type Name Description
    System.Int32 lcid

    An LCID identifier

    System.Boolean includeCountry

    if true the returned ISO language code includes the ISO country code separated from the language code with a dash (e.g. en-US). If false only the 2 character ISO language code will be returned.

    Returns
    Type Description
    System.String

    The ISO code corresponding to lcid

    Remarks

    This method also supports the TRADOS specific locales that are not otherwise supported by Windows and .NET.

    GetLanguageCode(Int32)

    Convert a TRADOS primary language code to a TRADOS language code string.

    Declaration
    public static string GetLanguageCode(int primaryLanguageCode)
    Parameters
    Type Name Description
    System.Int32 primaryLanguageCode

    the primary language code

    Returns
    Type Description
    System.String

    the converted string

    GetLcidFromIsoCode(String)

    Converts an ISO code to an LCID, taking TRADOS specific values into account.

    Declaration
    public static int GetLcidFromIsoCode(string isoCode)
    Parameters
    Type Name Description
    System.String isoCode

    The ISO code

    Returns
    Type Description
    System.Int32

    The LCID corresponding to isoCode

    GetLcids(Int32)

    Returns all possible LCID values for the specified TRADOS primary language code.

    Declaration
    public static int[] GetLcids(int primaryLanguageCode)
    Parameters
    Type Name Description
    System.Int32 primaryLanguageCode

    the primary language code

    Returns
    Type Description
    System.Int32[]

    All possible LCID values for the specified TRADOS primary language code.

    GetLocaleInfo(LanguageFormat, Boolean)

    Retrieves the locale info.

    Declaration
    public string GetLocaleInfo(LanguageFormat languageFormat, bool includeCountry)
    Parameters
    Type Name Description
    LanguageFormat languageFormat

    An enum specifying whether to return the language info as English, Native or ISO form.

    System.Boolean includeCountry

    A boolean specifying whether to mention the region in the return string.

    Returns
    Type Description
    System.String

    A string describing the Locale id.

    GetLocaleInfo(Int32, LanguageFormat, Boolean)

    Retrieves the locale info.

    Declaration
    public static string GetLocaleInfo(int lcid, LanguageFormat languageFormat, bool includeCountry)
    Parameters
    Type Name Description
    System.Int32 lcid

    A Windows locale ID.

    LanguageFormat languageFormat

    An enum specifying whether to return the language info as English, Native or ISO form.

    System.Boolean includeCountry

    A boolean specifying whether to mention the region in the return string.

    Returns
    Type Description
    System.String

    A string describing the Locale id.

    GetNativeLanguageNameFromLcid()

    Returns the language name in native format (script, spelling and form)

    Declaration
    public string GetNativeLanguageNameFromLcid()
    Returns
    Type Description
    System.String

    The language name in native format (script, spelling and form).

    GetNativeLanguageNameFromLcid(Int32)

    Returns the language name in native format (script, spelling and form)

    Declaration
    public static string GetNativeLanguageNameFromLcid(int lcid)
    Parameters
    Type Name Description
    System.Int32 lcid

    An LCID.

    Returns
    Type Description
    System.String

    The native language name of the locale specified by lcid.

    GetNativeNameFromLcid(Int32)

    Returns the language name and region name in native format (script, spelling and form)

    Declaration
    public static string GetNativeNameFromLcid(int lcid)
    Parameters
    Type Name Description
    System.Int32 lcid

    An LCID.

    Returns
    Type Description
    System.String

    The native language and region name of the locale specified by lcid.

    GetSchema()

    Always returns null.

    Declaration
    public XmlSchema GetSchema()
    Returns
    Type Description
    System.Xml.Schema.XmlSchema

    Always returns null.

    IsDefaultForCountry(Int32)

    Determines whether this is the default LCID for the country

    Declaration
    public static bool IsDefaultForCountry(int lcid)
    Parameters
    Type Name Description
    System.Int32 lcid

    An LCID identifier

    Returns
    Type Description
    System.Boolean

    Whether this is the default LCID for the country

    IsInstalledLcid(Int32)

    true if the specified LCID is supported by this operating system installation.

    Declaration
    public static bool IsInstalledLcid(int lcid)
    Parameters
    Type Name Description
    System.Int32 lcid

    Locale identifier of the locale to validate

    Returns
    Type Description
    System.Boolean

    true if the specified LCID is supported by this operating system installation.

    Remarks

    The implementation calls IsValidLocale on the Win32 API.

    Note that this returns false for proprietary TRADOS "LCID" values.

    IsProprietaryLcid(Int32)

    true if the LCID is one of the TRADOS proprietary "LCID" values.

    Declaration
    public static bool IsProprietaryLcid(int lcid)
    Parameters
    Type Name Description
    System.Int32 lcid

    Locale identifier of the locale to validate

    Returns
    Type Description
    System.Boolean

    true if the LCID is one of the TRADOS proprietary "LCID" values.

    ReadXml(XmlReader)

    Reads the 5-letter (TRADOS) ISO code from a <Language> element.

    Declaration
    public void ReadXml(XmlReader reader)
    Parameters
    Type Name Description
    System.Xml.XmlReader reader

    the XmlReader to use

    ToString()

    Returns a System.String representing the Language object.

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

    A System.String representing the Language object.

    Overrides
    System.ValueType.ToString()

    UsesCharacterCounts()

    Returns true if the language uses character counts.

    Declaration
    public bool UsesCharacterCounts()
    Returns
    Type Description
    System.Boolean

    true if the language uses character counts.

    UsesCharacterCounts(Int32)

    Returns true if the language (LCID) uses character counts.

    Declaration
    public static bool UsesCharacterCounts(int lcid)
    Parameters
    Type Name Description
    System.Int32 lcid

    The LCID of the language.

    Returns
    Type Description
    System.Boolean

    true if the language (LCID) uses character counts.

    WriteXml(XmlWriter)

    Writes the 5-letter (TRADOS) ISO code to a <Language> element.

    Declaration
    public void WriteXml(XmlWriter writer)
    Parameters
    Type Name Description
    System.Xml.XmlWriter writer

    the XmlWriter to use

    Implements

    System.Xml.Serialization.IXmlSerializable

    On this page

    • Constructors
      • LegacyTradosLanguage(Int32)
      • LegacyTradosLanguage(String)
    • Properties
      • IsInstalled
      • IsoCode
      • IsProprietary
      • IsValid
      • Lcid
    • Methods
      • Equals(Object)
      • GetAllLcids()
      • GetEnglishLanguageNameFromLcid()
      • GetEnglishLanguageNameFromLcid(Int32)
      • GetEnglishNameFromLcid(Int32)
      • GetHashCode()
      • GetIsoCodeFromLcid(Int32, Boolean)
      • GetLanguageCode(Int32)
      • GetLcidFromIsoCode(String)
      • GetLcids(Int32)
      • GetLocaleInfo(LanguageFormat, Boolean)
      • GetLocaleInfo(Int32, LanguageFormat, Boolean)
      • GetNativeLanguageNameFromLcid()
      • GetNativeLanguageNameFromLcid(Int32)
      • GetNativeNameFromLcid(Int32)
      • GetSchema()
      • IsDefaultForCountry(Int32)
      • IsInstalledLcid(Int32)
      • IsProprietaryLcid(Int32)
      • ReadXml(XmlReader)
      • ToString()
      • UsesCharacterCounts()
      • UsesCharacterCounts(Int32)
      • WriteXml(XmlWriter)
    • Implements
    Back to top Generated by DocFX