XmlLanguage.GetLanguage Method (String)


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

Namespace:   System.Windows.Markup
Assembly:  PresentationCore (in PresentationCore.dll)

public static XmlLanguage GetLanguage(
	string ietfLanguageTag


Type: System.String

An RFC 3066 language string, or empty string.

Return Value

Type: System.Windows.Markup.XmlLanguage

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

Exception Condition

ietfLanguageTag parameter cannot be null.


ietfLanguageTag parameter was non-empty, but did not conform to the syntax specified in RFC 3066. See 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.

.NET Framework
Available since 3.0
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Return to top