Hi,<div><br></div><div>Currently, in Epiphany we allow the user to enable spell checking, but it just silently fails if the appropriate dictionaries are not installed. I suggested that we should install missing dictionaries with PackageKit, and Carlos suggested that dictionary installation should be handled by the application and not WebKit.</div><div><br></div><div>To do this, I suggest the following new API in [1]:</div><div><br></div><div><pre style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0.4); word-wrap: break-word;">/**
 * webkit_web_context_get_available_spell_checking_languages:
 * @context: a #WebKitWebContext
 *
 * Get the list of languages with installed spell checking dictionaries. Any
 * dictionary recognized by Enchant will be detected.
 *
 * Returns: (array zero-terminated=1) (element-type utf8) (transfer full): A
 *    %NULL-terminated array of languages if available, or %NULL otherwise.
 *    Free with g_strfreev().
 *
 * Since: 2.8
 */
gchar** webkit_web_context_get_available_spell_checking_languages(WebKitWebContext* context)</pre><pre style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0.4); word-wrap: break-word;"><br></pre><pre style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0.4); word-wrap: break-word;">Then in Epiphany we'll just search that list for whatever languages the user has enabled and install the relevant hunspell/myspell dictionary (/usr/share/myspell/xx_XX.dic) with PackageKit if not present.</pre><pre style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0.4); word-wrap: break-word;"><br></pre><pre style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0.4); word-wrap: break-word;">An alternative would be to not provide any new API and have Epiphany search for the presence of the dictionaries manually. The disadvantage of this approach is that it would fail to detect Enchant dictionaries not provided by hunspell/myspell that are already installed. I'm not sure how common those are.</pre><pre style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0.4); word-wrap: break-word;"><br></pre><pre style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0.4); word-wrap: break-word;">[1] <a href="https://bugs.webkit.org/show_bug.cgi?id=140638">https://bugs.webkit.org/show_bug.cgi?id=140638</a></pre></div>