2

I'm using this embeded WPF's TextBox on my WinForms application. It didn't worked until I set the Language property to System.Windows.Markup.XmlLanguage.GetLanguage("en-US");. It worked fine but only for the English-us language. I read the .NET language pack is needed to use others languages so I downloaded it from Microsoft site and the setup says I've already it installed on my machine.

For example it works:

box.Language = System.Windows.Markup.XmlLanguage.GetLanguage("en-US");

but this doesn't:

box.Language = System.Windows.Markup.XmlLanguage.GetLanguage("pt-BR");

I was using this

box.Language = XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.IetfLanguageTag));

until I noticied it doesn't works for other languages, only English.

I'm not posting a duplicate of my code because it same as the one in the accepted answer I linked except I have Language property set.

Community
  • 1
  • 1
Jack
  • 16,276
  • 55
  • 159
  • 284
  • 3
    AFAIK, only English, Spanish, German, and French are supported in WPF, regardless of language packs that are installed. Portuguese is not supported. MSDN blog post covers that [here](http://blogs.msdn.com/b/text/archive/2009/10/02/custom-dictionaries.aspx) - I don't think it has changed since. – vcsjones Apr 14 '15 at 16:52
  • This is sad. Third party libraries has better support than the ones from Microsoft itself? I bet on somewhere in the OS' libraries have a spell checker for the OS' installed language... – Jack Apr 14 '15 at 17:02
  • @vcsjones: I think you should post it as answer then... – Jack Apr 15 '15 at 02:27

1 Answers1

2

I was trying to figure it out for a while and I found out that you need a Windows Language Pack for desired language as well. So, you have to download full Windows translation. Spellchecking works for all languages supported by Windows. You will probably need .NET 4.6.1 with language packs as well.

Niko
  • 812
  • 9
  • 22