Skip to content

Latest commit

 

History

History
43 lines (29 loc) · 1.9 KB

language.md

File metadata and controls

43 lines (29 loc) · 1.9 KB
-api-id -api-type
T:Windows.Globalization.Language
winrt class

Windows.Globalization.Language

-description

A class that provides information related to BCP-47 language tags such as the language name and the script.

-remarks

If your app passes language tags used in 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:

Language tags support the Unicode extensions "ca-" and "nu-". (See Unicode Key/Type Definitions.) Note that these extensions can affect the calendar used by Calendar objects.

Version history

Windows version SDK version Value added
1803 17134 LayoutDirection
2004 19041 AbbreviatedName
2004 19041 GetMuiCompatibleLanguageListFromLanguageTags

-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;

-see-also

OCR sample (Windows 10), Globalization preferences sample (Windows 10)