Επεξεργασία

Κοινή χρήση μέσω


XmlLanguage.GetLanguage(String) Method

Definition

Returns a XmlLanguage instance, based on a string representing the language per RFC 3066.

public:
 static System::Windows::Markup::XmlLanguage ^ GetLanguage(System::String ^ ietfLanguageTag);
public static System.Windows.Markup.XmlLanguage GetLanguage (string ietfLanguageTag);
static member GetLanguage : string -> System.Windows.Markup.XmlLanguage
Public Shared Function GetLanguage (ietfLanguageTag As String) As XmlLanguage

Parameters

ietfLanguageTag
String

An RFC 3066 language string, or empty string.

Returns

A new XmlLanguage with the provided string as its IetfLanguageTag value.

Exceptions

ietfLanguageTag parameter cannot be null.

ietfLanguageTag parameter was non-empty, but did not conform to the syntax specified in RFC 3066.

Remarks

This method is effectively the constructor.

The language string may be empty, or else must conform to RFC 3066 rules:

  • The first subtag must consist of only ASCII letters.

  • Additional subtags must consist ASCII letters or numerals.

  • Subtags are separated by a single hyphen character.

  • Every subtag must be 1 to 8 characters long.

  • No leading or trailing hyphens are permitted.

Applies to