This commit is contained in:
Steven 2023-02-01 10:34:35 -08:00
Родитель c9ba53b4e9
Коммит 856d76e10b
1 изменённых файлов: 17 добавлений и 11 удалений

Просмотреть файл

@ -39,25 +39,30 @@ CoreWebView2ControllerOptions CreateAndInitializeCoreWebView2ControllerOptions(C
# API Details
```cpp
[uuid(0c9a374f-20c3-4e3c-a640-67b78a7e0a48), object, pointer_default(unique)]
interface ICoreWebView2ControllerOptions : IUnknown {
/// The default locale for the WebView2. 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
[uuid(06c991d8-9e7e-11ed-a8fc-0242ac120002), object, pointer_default(unique)]
interface ICoreWebView2ControllerOptions2 : ICoreWebView2ControllerOptions {
/// The default locale for the WebView2. 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. Example: `Intl.DateTimeFormat().format(new Date())`
/// The intended locale value is in the format of
/// BCP 47 Language Tags. More information can be found from
/// BCP 47 Language Tags. More information can be found from
/// [IETF BCP47](https://www.ietf.org/rfc/bcp/bcp47.html).
///
/// This property sets the locale for a CoreWebView2Environment during its creation.
/// Creating a new CoreWebView2Environment object that connects to an already running
/// browser process cannot change the locale previously set by an earlier CoreWebView2Environment.
/// The CoreWebView2Environment and all associated webview2 objects will need to closed.
/// This property sets the locale for a CoreWebView2Environment used to create the
/// WebView2ControllerOptions object, which is passed as a parameter in
/// `CreateCoreWebView2ControllerWithOptions`.
///
/// The default value for ScriptLocale will be depend on the WebView2 language
/// Changes to the ScriptLocale property apply to renderer processes created after
/// the change. Any existing renderer processes will continue to use the previous
/// ScriptLocale value. To ensure changes are applied to all renderer process,
/// close and restart the CoreWebView2Environment and all associated WebView2 objects.
///
/// The default value for ScriptLocale will 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 ScriptLocale** |
/// |-----------|-------------------|-------------------------------|
/// | en-GB | en-US | en-GB |
@ -79,6 +84,7 @@ interface ICoreWebView2ControllerOptions : IUnknown {
/// CultureInfo cultureInfo = Thread.CurrentThread.CurrentCulture;
/// return cultureInfo.Name
/// ```
///
/// The caller must free the returned string with `CoTaskMemFree`. See
/// [API Conventions](/microsoft-edge/webview2/concepts/win32-api-conventions#strings).
/// \snippet AppWindow.cpp ScriptLocaleSetting