CoreWebView2ControllerOptions.LocaleRegion Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Manages the value of the controller's locale region.
public string LocaleRegion { get; set; }
member this.LocaleRegion : string with get, set
Public Property LocaleRegion As String
Property Value
Remarks
The LocaleRegion
property is to specify the default locale region. It sets the default locale for all Intl JavaScript APIs and other JavaScript APIs that depend on it, namely Intl.DateTimeFormat()
which affects string formatting like in the time/date formats.The intended locale value is in the format of BCP 47 Language Tags. More information can be found from IETF BCP47.
The default value for LocaleRegion will be depend on the WebView2 language and OS region. If the language portions of the WebView2 language and OS region match, then it will use the OS region. Otherwise, it will use the WebView2 language.
OS Region | WebView2 Language | Default WebView2 LocaleRegion | |
---|---|---|---|
en-GB | en-US | en-GB | |
es-MX | en-US | en-US | |
en-US | en-GB | en-US |
CultureInfo cultureInfo = Thread.CurrentThread.CurrentCulture;
return cultureInfo.Name