ApplicationLanguages ApplicationLanguages ApplicationLanguages ApplicationLanguages ApplicationLanguages Class


Some information relates to pre-released product which may be substantially modified before it’s commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Prerelease APIs are identified by a Prerelease label.

[Contains prerelease APIs.]
Specifies the language-related preferences that the app can use and maintain.

public : static class ApplicationLanguages
static struct winrt::Windows::Globalization::ApplicationLanguages
public static class ApplicationLanguages
Public Static Class ApplicationLanguages
// This class does not provide a public constructor.
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)


The languages referenced in this class are represented by BCP-47 language tags. Each of these is a language identifier and not a locale name, although the two structurally can be the same. As a language tag, "en-US" means American English (or the dialect of English spoken in the United States). It makes no claims about the actual location of the speakers (though many of them do reside in the US) and no other claims about conventions that are used in the US such as the measurement system or currency.


Windows.Globalization.ApplicationLanguages.PrimaryLanguageOverride = "en-US"


If your app passes language tags from this class to any National Language Support functions, it must first convert the tags by calling ResolveLocaleName.

Starting in :

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

UWP apps can be deployed using resource packages. When language resource packages are used, the packages that are installed and registered for a given user are determined by the languages in the user's language profile. As a result, not all of the languages included in the app bundle that was submitted to the Microsoft Store will necessarily be available for use at runtime. The PrimaryLanguageOverride property should only be set to languages that are available for the user.

The languages available for the app to use as an ApplicationLanguages object at runtime are limited to those languages included in the main app package manifest and the languages corresponding to language resource packages that are applicable for the user (determined by matching languages in the user's preferences), and that are installed and registered for the user. The ApplicationLanguages.ManifestLanguages property reflects language resource packs that are available for the user, and hence returns an appropriate set of languages that can be used for setting the PrimaryLanguageOverride property.

The ApplicationLanguages.Languages property will return a very similar list to the ManifestLanguages property. It may differ in including regional language variations not listed in any package manifest; for example, "en-CA" (English (Canada)) can be returned by the Languages property if the user has "en-CA" in their profile and the app supports any regional variety of English. Such user-derived regional language variations can be preferable for setting the PrimaryLanguageOverride property since the app will then provide globalization behaviors more appropriate for the user.

If a language is in the main app package but is not a match for any language in the user's preference, it is returned by the ManifestLanguages property but not the Languages property. These can also be used for setting the PrimaryLanguageOverride property. However, since these languages are not reflected in the user's preferences, the user might not understand those languages. Such settings should be used only when chosen directly by the user.


Languages Languages Languages Languages Languages

Gets the ranked list of current runtime language values preferred by the user.

public : static IVectorView<Platform::String> Languages { get; }
static IVectorView<winrt::hstring> Languages();
public static IReadOnlyList<string> Languages { get; }
Public Static ReadOnly Property Languages As IReadOnlyList<string>
var iReadOnlyList = Windows.Globalization.ApplicationLanguages.languages;
IReadOnlyList<string> IReadOnlyList<string> IReadOnlyList<string>

A computed list of languages that merges the app's declared supported languages (ApplicationLanguages.ManifestLanguages ) with the user's ranked list of preferred languages.


This list is the recommended source of the best current runtime language value(s) preferred by the user.


This property yields the same values as the language list exposed by Windows.ApplicationModel.Resources.Core.ResourceManager.DefaultContext.Languages.

See Also

ManifestLanguages ManifestLanguages ManifestLanguages ManifestLanguages ManifestLanguages

Gets the app's declared list of supported languages.

public : static IVectorView<Platform::String> ManifestLanguages { get; }
static IVectorView<winrt::hstring> ManifestLanguages();
public static IReadOnlyList<string> ManifestLanguages { get; }
Public Static ReadOnly Property ManifestLanguages As IReadOnlyList<string>
var iReadOnlyList = Windows.Globalization.ApplicationLanguages.manifestLanguages;
IReadOnlyList<string> IReadOnlyList<string> IReadOnlyList<string>

The list of supported languages declared in the app's manifest.


Starting in :

UWP apps can be deployed using resource packages. When language resource packages are used, the packages that are installed and registered for a given user are determined by the languages in the user's language profile. The set of languages returned by the ManifestLanguages property is limited to the languages currently available on the system for the user. Languages included in the main app package manifest will always be returned; languages from resource packs will be returned only if the language is applicable for the user (that is, is in the user's preferences) and that resource package has been installed and registered for the user at the time the property is accessed.

PrimaryLanguageOverride PrimaryLanguageOverride PrimaryLanguageOverride PrimaryLanguageOverride PrimaryLanguageOverride

Gets or sets an override for the app's preferred language, expressed as a BCP-47 language tag. This setting is persisted.

public : static Platform::String PrimaryLanguageOverride { get; set; }
static winrt::hstring PrimaryLanguageOverride();

static void PrimaryLanguageOverride(winrt::hstring primarylanguageoverride);
public static string PrimaryLanguageOverride { get; set; }
Public Static ReadWrite Property PrimaryLanguageOverride As string
var string = Windows.Globalization.ApplicationLanguages.primaryLanguageOverride;
applicationLanguages.primaryLanguageOverride = string;
string string string

A BCP-47 language tag. The app can set it to override the top language of the user's ranked list of preferred languages (ApplicationLanguages.Languages ), and its value will persist between app sessions. It must be a single language tag; a delimited list of language tags will fail.

When your app gets the value, PrimaryLanguageOverride returns either a single language tag (if your app has previously set the property) or an empty string.


Apps normally run with language settings determined by the system by comparing the languages supported by the app with the language preferences of the user. The settings for that system behavior can be obtained using the ApplicationLanguages.Languages property. The PrimaryLanguageOverride property is used to override that behavior by setting a specific language as the first language in the Languages list.

The PrimaryLanguageOverride setting is persisted between sessions. It should not be set each time the app is loaded. It should only be set based on user input presented in settings UI. The property can be read at any time. If the property has never been set, it returns an empty string.

When you set the PrimaryLanguageOverride, this is immediately reflected in the ApplicationLanguages.Languages property. However, this change may not take effect immediately on resources loaded in the app UI. To make sure the app responds to such changes, you can listen to the QualifierValues property on a default resource context and take whatever actions may be needed to reload resources. Those requirements may vary depending on the UI framework used by the app, and it may be necessary to restart the app.

See Also


GetLanguagesForUser(User) GetLanguagesForUser(User) GetLanguagesForUser(User) GetLanguagesForUser(User) GetLanguagesForUser(User)

Prerelease. Retrieves the language preferences of the specified user. This API is part of support for multi-user apps (MUA).

public : static IVectorView<Platform::String> GetLanguagesForUser(User user)
IVectorView<winrt::hstring> GetLanguagesForUser(User user) const;
public static IReadOnlyList<string> GetLanguagesForUser(User user)
Public Static Function GetLanguagesForUser(user As User) As IReadOnlyList<string>( Of string )
var iVectorView = Windows.Globalization.ApplicationLanguages.getLanguagesForUser(user);
User User User

The user to retrieve preferences for.

IReadOnlyList<string> IReadOnlyList<string> IReadOnlyList<string>

A list of normalized BCP-47 language tags representing the language preferences of the specified user.

Additional features and requirements
Device family
Windows 10 Insider Preview (introduced v10.0.17110.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v6)

See Also