WPF中有没有使用澳大利亚英语词典的方法

时间:2022-02-08 20:25:25

So In WPF I can declare a Rich Text Box like so

在WPF中,我可以像这样声明一个富文本框

<RichTextBox Text="{Binding Text}" SpellCheck.IsEnabled="True" />

and through some miracle little wibbly lines appear under misspelt words.

通过一些奇迹,在拼错的词下面出现了一些线。

But the dialect used is an American that has all kinds of differences that are unacceptable for an Australian audience.

但是使用的方言是一个美国人,有各种各样的不同,这是澳大利亚观众所不能接受的。

I know I can do this...

我知道我能做到……

<RichTextBox Text="{Binding Text}" SpellCheck.IsEnabled="True" >
  <SpellCheck.CustomDictionaries>
    <!-- customwords.lex is included as a content file-->
    <sys:Uri>pack://application:,,,/customwords.lex</sys:Uri>
  </SpellCheck.CustomDictionaries>
</RichTextBox>

and fill customwords.lex with the words that are different like so.

和填补customwords。莱科斯用不同的词语。

#LID 1033
colour
summarising
Summarise
Organisation
maximise
etc...

Frankly it is a little onerous for me to go out and fill the custom dictionary with all the extra different words and it still won't highlight the Americanisms which wrong in an Australian context.

坦白地说,我出去用所有不同的词填满自定义字典是有点麻烦的,而且它仍然不会突出在澳大利亚语境中错误的美式英语。

I looked around for .Net Language packs and if I wanted just about any other language than a dialect of English I think I'd be alright but there is no English (Australian or UK) that I can use.

我四处寻找。net语言包,如果我想要除了英语方言以外的任何其他语言,我想我没问题,但是我不能使用英语(澳大利亚或英国)。

Do I just turn off spell checking? or is there a way to get the right Dictionary in there.

我要关掉拼写检查吗?或者有没有办法找到合适的字典。

1 个解决方案

#1


4  

I found the solution and created a style that achieves what I want. Now all RichTextBoxes are spell checked appropriately.

我找到了解决方案,并创建了一种能够实现我想要的风格。现在所有的richtextbox都被正确地选中了。

<Style TargetType="RichTextBox">
    <Setter Property="SpellCheck.IsEnabled"  Value="True" />
    <Setter Property="Language"  Value="en-au" />
</Style>

#1


4  

I found the solution and created a style that achieves what I want. Now all RichTextBoxes are spell checked appropriately.

我找到了解决方案,并创建了一种能够实现我想要的风格。现在所有的richtextbox都被正确地选中了。

<Style TargetType="RichTextBox">
    <Setter Property="SpellCheck.IsEnabled"  Value="True" />
    <Setter Property="Language"  Value="en-au" />
</Style>