简体   繁体   English

如何更改 Microsoft Edge/WebView2 中用于拼写检查的语言?

[英]How can I change the language used for spell checking in Microsoft Edge/WebView2?

We're using WebView2 in a rich Delphi application as an html editor with document.designMode = 'on' .我们在丰富的 Delphi 应用程序中使用 WebView2 作为 html 编辑器,其中document.designMode = 'on'

WebView2 is doing a spell check by default (which is fine). WebView2 默认进行拼写检查(这很好)。 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).我们尝试设置各种 html 标记的语言属性(在加载到编辑器之前以编程方式操作 dom 和/或源)。 But this seems not to have any effect.但这似乎没有任何效果。

I'm using opera to write this and "english" is used for spell checking here.我正在使用 Opera 来写这个,“english”在这里用于拼写检查。 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?对此有什么想法吗?

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. CoreWebView2EnvironmentOptions.Language 属性可能会更改默认的拼写检查语言(我还没有验证过),但 WebView2 目前没有更改拼写检查设置的机制。 You can add your feedback to the spell check API feature request on our feedback github project.您可以在我们的反馈 github 项目上将您的反馈添加到拼写检查 API 功能请求中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM