| 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.
Namespace: Sdl.Core.Globalization
The Language type exposes the following members.
| Name | Description | |
|---|---|---|
| Language |
Default constructor, creates an invalid language object.
| |
| Language(CultureInfo) |
Construction from an existing CultureInfo instance.
| |
| Language(String) |
Construction from an ISO abbreviation string.
See IsoAbbreviation for information about the expected format
of the string.
| |
| Language(Language) |
Protected constructor used in cloning.
|
| Name | Description | |
|---|---|---|
| CultureInfo |
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.
| |
| DefaultDisplaySettings |
Default settings for how languages should be shown to users.
| |
| DefaultSpecificCulture | Obsolete.
Default specific language
| |
| DefaultSpecificCultureCode | Obsolete.
ISO code of the default specific culture, used mostly in serialization/deserialization
| |
| DefaultSpecificLanguage |
Default specific language language
| |
| DefaultSpecificLanguageCode |
ISO code of the default specific culture, used mostly in serialization/deserialization
| |
| Direction |
Marks the direction of the language, can be "ltr"-left-to-right or "rtl"-right-to-left
| |
| DisplayName |
Returns the name of the language as it should be displayed to users.
| |
| EnglishName |
English name of the language; is set automatically from CultureInfo; can't set it programatically
| |
| Image |
The flag image used for showing this language in the user interface.
| |
| IsNeutral |
Marks a neutral language
| |
| IsoAbbreviation |
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.
| |
| IsSupported | true if the language is valid and supported on this system.
| |
| IsValid | true if an ISO abbreviation has been set for the language.
| |
| LanguageCode |
The ISO formatted code corresponding to the Language
| |
| LdmlData |
Ldml Data for the language
| |
| ParentIsoCode | Obsolete.
OBSOLETE,use ParentLanguageCode
| |
| ParentLanguage |
Parent language
| |
| ParentLanguageCode |
ISO code of the parent language, used mostly in serialization/deserialization
| |
| RegionalVariants |
List of the regional variants of the language
| |
| SupportedProducts |
Dictionary of supported products and their respective alternative language codes
| |
| UseBlankAsSentenceSeparator | ||
| UseBlankAsWordSeparator | ||
| UsesCharacterCounts | true if the language uses character counts rather than word counts.
|
| Name | Description | |
|---|---|---|
| Clone |
Create an identical clone of this object.
| |
| Equals(Object) | true if the ISO abbreviation for the two languages correspond.
(Overrides ObjectEquals(Object).) | |
| Equals(String, String) | true if the two strings are the same, ignoring case.
| |
| Equals(Language, Language) | true if both objects are null or if they represent the same language.
| |
| Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
| GetAllLanguages |
Returns all languages supported by the system.
| |
| GetAlternativeLanguageCodes | Obsolete.
Gets an alternative language code for the language, based on the product ID
| |
| GetDisplayName |
Returns a name of the language that may be displayed to users.
| |
| GetHashCode |
Hash code based on the ISO abbreviation for the language.
(Overrides ObjectGetHashCode.) | |
| GetImage |
Get an image associated with the language for use in user interfaces.
| |
| GetType | Gets the Type of the current instance. (Inherited from Object.) | |
| IsNullOrInvalid | true if the language object is null or not initialized.
| |
| MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
| ToString |
The ISO abbreviation for the language.
(Overrides ObjectToString.) |