Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to use an Australian English dictionary in WPF

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

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

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

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

like image 503
Peter Avatar asked Nov 21 '11 03:11

Peter


1 Answers

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

<Style TargetType="RichTextBox">
    <Setter Property="SpellCheck.IsEnabled"  Value="True" />
    <Setter Property="Language"  Value="en-au" />
</Style>
like image 125
Peter Avatar answered Oct 20 '22 09:10

Peter