Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
382 views
in Technique[技术] by (71.8m points)

c# - WPF spell check languages

I'm trying to enable spell checking on a RichTextBox in a small WPF application. Most of the documents for the application are in danish. I would prefer to use natively WPF spell checking like

<RichTextBox Name="rtb" SpellCheck.IsEnabled="True" xml:lang="da"></RichTextBox>

I've googled most of the web (or so it seems) - and I can only find old posts from 2009/2010 saying only english, german, french and spanish are supported. My thought was more languages ought to be supported by now - but can find no information on this.

Can anyone confirm that still only those four languages are supported - or better yet tell me, that danish is also supported natively by WPF?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Please see this blog post from the WPF team that elaborates a bit more.

In configurations where only 4 languages are supported, you just need to set xml:lang correctly - I don't believe that you need to installe any additional lang-packs.

On platforms that support additional languages, the OS needs the underlying platform support to be enabled first. This support can be enabled by installing the corresponding Feature On Demand package (FoD) package.

The KB article linked above doesn't elaborate on precisely how to install the right FoD package. You can do this in one of the two ways -

  • Add the corresponding keyboard.
    • In Win10, go to Settings -> Time & Language -> Region & Language -> Add a Language. By default, this will add keyboard support for the language in question (this does not add language packs by default). The OS will notify Windows Update to download and install the corresponding FoD package automatically (you'll see a notification indicating that new features are being installed). Once this is done, WPF will start supporting spell checking for the language you just enabled.
  • You can also enable it using DISM by following the instructions here. The packages to look for are the 'Basic' ones. This can be done in 'online' mode (i.e., in an up-and-running OS), or during OS image creation offline (usually done for repeatable deployments).

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...