1

We're using WebView2 in a rich Delphi application as an html editor with document.designMode = 'on'.

WebView2 is doing a spell check by default (which is fine). But we want to change the language, in which the spell checking is done independent from the users settings in the OS. We have multilangual users in our system, so the language has do be switched on runtime.

We've tried to set the lang-attribute of various html-tags (programatically manipulating the dom and/or the source before it's loaded to the editor). But this seems not to have any effect.

I'm using opera to write this and "english" is used for spell checking here. If I'm using edge, this text field here is checked in "german". That's a bad sign, that this might be possible at all. I'm hoping here is something missing, too.

Any ideas for this?

1 Answer 1

2

There's the CoreWebView2EnvironmentOptions.Language property which may change the default spell check language (I haven't verified this) but otherwise WebView2 doesn't currently have a mechanism to change spell check settings. You can add your feedback to the spell check API feature request on our feedback github project.

Sign up to request clarification or add additional context in comments.

2 Comments

We've tried this solution. But there is no way to get or manipulate an instance of the CoreWebView2EnvironmentOptions outside a C++ application (we're using delphi). It seems so, that microsoft's dll is missing some create functions to get an valid instance of this interface.
WebView2 package provides implementations of ICoreWebView2EnvironmentOptions interface, but you can also implement that interface yourself. Its a bunch of property getters and setters. You can see the C++ implementation of the interface in the header file in the webview2 nuget package.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.