Click or drag to resize
Language Class

Represents a language in the sense of a CultureInfo object, using a mechanism that allows basic manipulations on a system where the language is not fully supported.

The reason we use this type as opposed to the CultureInfo class in the .NET Framework is that when working with files we may convert the file on a system that supports a particular language (i.e. the CultureInfo for this language abbreviation is known), but the file may subsequently be opened on a system that does not yet have support for this language.

Depending on what processing is to be done this may be a perfectly valid use case, and it would be too harsh a restriction to require support for the language to be installed on all systems that may ever look at the file.

Under normal circumstances the language should be created from a CultureInfo object.

In addition this wrapper allows a language to be represented by a plain string when no CultureInfo for this language is supported on the system, and thus allows the language to be represented until some truly language specific processing is needed (i.e. when the corresponding CultureInfo is required).

When supported by the operating system the corresponding CultureInfo can be obtained directly from the CultureInfo property. If not supported this will throw an UnsupportedLanguageException.

Use the IsValid and IsSupported properties to determine if the language has been set and whether it is supported by the operating system.

Inheritance Hierarchy
SystemObject
  Sdl.Core.GlobalizationLanguage

Namespace: Sdl.Core.Globalization
Assembly: Sdl.Core.Globalization (in Sdl.Core.Globalization.dll) Version: 1.8.0.0 (1.8.2687.0)
Syntax
[SerializableAttribute]
public class Language : ICloneable

The Language type exposes the following members.

Constructors
  NameDescription
Public methodLanguage
Default constructor, creates an invalid language object.
Public methodLanguage(CultureInfo)
Construction from an existing CultureInfo instance.
Public methodLanguage(String)
Construction from an ISO abbreviation string. See IsoAbbreviation for information about the expected format of the string.
Protected methodLanguage(Language)
Protected constructor used in cloning.
Top
Properties
  NameDescription
Public propertyCultureInfo
The CultureInfo for this language. If this language is not supported on this machine an UnsupportedLanguageException is thrown. If the ISO abbreviation is null this property returns null.
Public propertyStatic memberDefaultDisplaySettings
Default settings for how languages should be shown to users.
Public propertyDefaultSpecificCulture Obsolete.
Default specific language
Public propertyDefaultSpecificCultureCode Obsolete.
ISO code of the default specific culture, used mostly in serialization/deserialization
Public propertyDefaultSpecificLanguage
Default specific language language
Public propertyDefaultSpecificLanguageCode
ISO code of the default specific culture, used mostly in serialization/deserialization
Public propertyDirection
Marks the direction of the language, can be "ltr"-left-to-right or "rtl"-right-to-left
Public propertyDisplayName
Returns the name of the language as it should be displayed to users.
Public propertyEnglishName
English name of the language; is set automatically from CultureInfo; can't set it programatically
Public propertyImage
The flag image used for showing this language in the user interface.
Public propertyIsNeutral
Marks a neutral language
Public propertyIsoAbbreviation
Follows the RFC 1766 standard in the format "[languagecode2]-[country/regioncode2]", where [languagecode2] is a lowercase two-letter code derived from ISO 639-1 and [country/regioncode2] is an uppercase two-letter code derived from ISO 3166. For example, U.S. English is "en-US". In cases where a two-letter language code is not available, the three-letter code derived from ISO 639-2 is used; for example, the three-letter code "div" is used for cultures that use the Dhivehi language.
Public propertyIsSupported
true if the language is valid and supported on this system.
Public propertyIsValid
true if an ISO abbreviation has been set for the language.
Public propertyLanguageCode
The ISO formatted code corresponding to the Language
Public propertyLdmlData
Ldml Data for the language
Public propertyParentIsoCode Obsolete.
OBSOLETE,use ParentLanguageCode
Public propertyParentLanguage
Parent language
Public propertyParentLanguageCode
ISO code of the parent language, used mostly in serialization/deserialization
Public propertyRegionalVariants
List of the regional variants of the language
Public propertySupportedProducts
Dictionary of supported products and their respective alternative language codes
Public propertyUseBlankAsSentenceSeparator
Public propertyUseBlankAsWordSeparator
Public propertyUsesCharacterCounts
true if the language uses character counts rather than word counts.
Top
Methods
  NameDescription
Public methodClone
Create an identical clone of this object.
Public methodEquals(Object)
true if the ISO abbreviation for the two languages correspond.
(Overrides ObjectEquals(Object).)
Public methodStatic memberEquals(String, String)
true if the two strings are the same, ignoring case.
Public methodStatic memberEquals(Language, Language)
true if both objects are null or if they represent the same language.
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 methodStatic memberGetAllLanguages
Returns all languages supported by the system.
Public methodGetAlternativeLanguageCodes Obsolete.
Gets an alternative language code for the language, based on the product ID
Public methodGetDisplayName
Returns a name of the language that may be displayed to users.
Public methodGetHashCode
Hash code based on the ISO abbreviation for the language.
(Overrides ObjectGetHashCode.)
Public methodGetImage
Get an image associated with the language for use in user interfaces.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodStatic memberIsNullOrInvalid
true if the language object is null or not initialized.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
The ISO abbreviation for the language.
(Overrides ObjectToString.)
Top
See Also
Community
Edit

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