A class that provides information related to BCP-47 language tags such as the language name and the script.
Syntax
var language = new Windows.Globalization.Language(string);
Attributes
- ActivatableAttribute(Windows.Globalization.ILanguageFactory, NTDDI_WIN8)
- DualApiPartitionAttribute()
- MarshalingBehaviorAttribute(Agile)
- StaticAttribute(Windows.Globalization.ILanguageStatics, NTDDI_WIN8)
- ThreadingAttribute(Both)
- VersionAttribute(NTDDI_WIN8)
Members
The Language class has these types of members:
Constructors
The Language class has these constructors.
| Constructor | Description |
|---|---|
| Language | Creates a Language object. |
Methods
The Language class has these methods. With C#, Visual Basic, and C++, it also inherits methods from the Object class.
| Method | Description |
|---|---|
| IsWellFormed | Determines whether a BCP-47 language tag is well-formed. |
Properties
The Language class has these properties.
| Property | Access type | Description |
|---|---|---|
| Read-only | Gets the BCP-47 language tag for the currently enabled keyboard layout or Input Method Editor (IME). | |
| Read-only | Gets a localized string that is suitable for display to the user for identifying the language. | |
| Read-only | Gets the normalized BCP-47 language tag for this language. | |
| Read-only | Gets the name of the language in the language itself. | |
| Read-only | Gets the four-letter ISO 15924 script code of the language. |
Remarks
Note If your app passes language tags from this class to any National Language Support functions, it must first convert the tags by calling ResolveLocaleName.
Initialize this class with a BCP-47 language tag. For example, to work with the best current user-preferred language, pass in the top value from Windows.System.UserProfile.GlobalizationPreferences:
Examples
// Get the top user-preferred language and its display name. var topUserLanguage = Windows.System.UserProfile.GlobalizationPreferences.languages[0]; var language = new Windows.Globalization.Language(topUserLanguage); var displayName = language.displayName;
Requirements
|
Minimum supported client | Windows 8 [Windows Store apps, desktop apps] |
|---|---|
|
Minimum supported server | Windows Server 2012 [Windows Store apps, desktop apps] |
|
Namespace |
|
|
Metadata |
|
Build date: 12/4/2012