Search code examples
c#wpfcefsharpchromium-embedded

in Cefsharp.WPF, how should I do spell check for "fi-FI" (Finnish) language?


I have WPF application which launches web apps. I want to have a spell check for the Finnish language. By default spell check for English is there. I have written the below code to add support to the Finnish language.

Cef.UIThreadTaskFactory.StartNew(delegate
                {
                    var browser = (sender as ChromiumWebBrowser);
                    var requestContext = browser.GetBrowserHost().RequestContext;
                    requestContext.SetPreference("browser.enable_spellchecking", true, out _);
                    requestContext.SetPreference("spellcheck.dictionaries", new List<string> { "en-US", "fi-FI" }, out _);
                });

When I set this code, there are below problems

  1. Spell check which was earlier working, red underline for incorrect words for the English language is stopped.
  2. Spell check is not working for Finnish language.
  3. I checked "C:\Users<someUser>\AppData\Local\CEF\User Data\Dictionaries", English dictornory got downloaded but not the Finnish.
  4. Does that mean that CEF doesn't support Finnish language, when I try "en-AU", this dictionary got downloaded.

Solution

  • Basically spell check is available for those languages of which dictionary is present, refer https://github.com/cvsuser-chromium/third_party_hunspell_dictionaries Also, I have asked a question on CEF Forum if we can add missing languages, refer post here - https://magpcss.org/ceforum/viewtopic.php?f=10&t=17852#p46719

    For now, there is no support for the Finnish language "fi-FI".