[webkit-gtk] API for spell check dictionary detection

Michael Catanzaro mcatanzaro at igalia.com
Mon Jan 19 13:31:07 PST 2015


Hi,

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.

To do this, I suggest the following new API in [1]:

/**
 * 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)

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.

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.

[1] https://bugs.webkit.org/show_bug.cgi?id=140638
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-gtk/attachments/20150119/e40768bf/attachment.html>


More information about the webkit-gtk mailing list