@@ -50,7 +50,7 @@ public CreateWebView2Controller(IntPtr parentWindow)
50
50
# API Details
51
51
``` cpp
52
52
[uuid(0c9a374f-20c3-4e3c-a640-67b78a7e0a48), object, pointer_default(unique)]
53
- interface ICoreWebView2ControllerOptions : IUnknown {
53
+ interface ICoreWebView2StagingControllerOptions : IUnknown {
54
54
/// Interface for locale region that is updated through the ControllerOptions
55
55
/// API.
56
56
/// The default region for WebView. It applies to browser UI such as
@@ -65,6 +65,21 @@ interface ICoreWebView2ControllerOptions : IUnknown {
65
65
/// If V8 cannot find any matching locale on the input value, it will default
66
66
/// to the display language as the locale.
67
67
///
68
+ /// The Windows API ` GetLocaleInfoEx ` can be used if the LocaleRegion value
69
+ /// is always set to match the OS region
70
+ ///
71
+ /// ```cpp
72
+ /// int LanguageCodeBufferSize =
73
+ /// ::GetLocaleInfoEx(LOCALE_NAME_USER_DEFAULT, LOCALE_SNAME, nullptr, 0);
74
+ /// std::unique_ptr<char[ ] > buffer(new char[ LanguageCodeBufferSize] );
75
+ /// WCHAR* w_language_code = new WCHAR[ LanguageCodeBufferSize] ;
76
+ /// ::GetLocaleInfoEx(LOCALE_NAME_USER_DEFAULT, LOCALE_SNAME, w_language_code,
77
+ /// LanguageCodeBufferSize);
78
+ /// wcstombs(buffer.get(), w_language_code, LanguageCodeBufferSize);
79
+ /// delete[ ] w_language_code;
80
+ /// return buffer;
81
+ /// ```
82
+ ///
68
83
/// The caller must free the returned string with ` CoTaskMemFree ` . See
69
84
/// [ API Conventions] ( /microsoft-edge/webview2/concepts/win32-api-conventions#strings ) .
70
85
/// \snippet AppWindow.cpp RegionLocaleSetting
0 commit comments