【问题标题】:Is there a way to use an Australian English dictionary in WPF有没有办法在 WPF 中使用澳大利亚英语词典
【发布时间】:2012-05-05 18:57:01
【问题描述】:

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

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

并且通过一些奇迹,在拼写错误的单词下出现了一些细小的线条。

但所使用的方言是一种美国方言,具有澳大利亚观众无法接受的各种差异。

我知道我能做到……

<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>

并用不同的单词填充customwords.lex。

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

坦率地说,我出去用所有额外的不同单词填写自定义词典有点麻烦,但它仍然不会突出在澳大利亚语境中错误的美国主义。

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

我是否只是关闭拼写检查?或者有没有办法在那里获得正确的字典。

【问题讨论】:

  • 这是一种真正的语言吗?
  • 是的,当短语“fair shit of the sav, mate”下面有一个大红色波浪线时,你会讨厌它。
  • @slugster - 我的眼睛拒绝阅读。
  • “别跟我一起吃生虾”当然是真正的语言。

标签: wpf richtextbox spell-checking


【解决方案1】:

我找到了解决方案并创建了一种可以实现我想要的样式。现在所有 RichTextBox 都经过了适当的拼写检查。

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-03-22
    • 2015-05-03
    • 1970-01-01
    • 2023-03-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多