After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 743069 - Properly handle languages that can't be spellchecked
Properly handle languages that can't be spellchecked
Status: RESOLVED OBSOLETE
Product: epiphany
Classification: Core
Component: General
unspecified
Other All
: Normal normal
: ---
Assigned To: Epiphany Maintainers
Epiphany Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-01-17 02:12 UTC by Michael Catanzaro
Modified: 2018-08-03 20:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Properly handle languages that can't be spellchecked (2.93 KB, patch)
2015-01-17 02:12 UTC, Michael Catanzaro
reviewed Details | Review
screenshot (32.85 KB, image/png)
2015-02-03 16:01 UTC, Michael Catanzaro
  Details

Description Michael Catanzaro 2015-01-17 02:12:44 UTC
A lot of the languages we offer in the preferences dialog do not contain a locale (e.g. simply en rather than en_US). This works for the Accept-Language header, but it's no good for spell checking. We need to make this clear in the UI. It'd also be good to not tell WebKit to try spellchecking these languages.
Comment 1 Michael Catanzaro 2015-01-17 02:12:46 UTC
Created attachment 294726 [details] [review]
Properly handle languages that can't be spellchecked

Generic languages like en don't have spell checking dictionaries.
Currently, spellchecking these languages silently fails.

* Only attempt to enable spell checking for specific dialects like en_US.
* Actually display in the UI when a language cannot be spellchecked.
Comment 2 Carlos Garcia Campos 2015-02-03 12:20:12 UTC
Review of attachment 294726 [details] [review]:

::: lib/ephy-langs.h
@@ +43,3 @@
+GHashTable		    *ephy_langs_iso_3166_table	   (void);
+
+gboolean		     ephy_lang_supports_spellcheck (char *);

Do not omit argument names in header protoypes. ephy_langs is the prefix, this should be ephy_langs_lang_support_spellcheck(), however I wonder if we should move to ephy-langs the normalize helper, with a less confusing name, ephy_langs_normalize_languages_for_spellchecking() or something like that, and supports_spellcheck would be a private function here.

::: src/prefs-dialog.c
@@ +545,3 @@
+		 */
+		name = g_strdup_printf (C_("language", "%s (Generic; no spell checking)"),
+					dgettext (ISO_639_DOMAIN, langname));

Could you show a screenshot of how this look?
Comment 3 Michael Catanzaro 2015-02-03 16:01:08 UTC
Created attachment 296037 [details]
screenshot

I will ping Allan; maybe he has a better idea.
Comment 4 Michael Catanzaro 2015-02-03 16:03:03 UTC
(In reply to comment #2)
> Do not omit argument names in header protoypes. ephy_langs is the prefix, this
> should be ephy_langs_lang_support_spellcheck(), however I wonder if we should
> move to ephy-langs the normalize helper, with a less confusing name,
> ephy_langs_normalize_languages_for_spellchecking() or something like that, and
> supports_spellcheck would be a private function here.

It looks like neither function needs to be in ephy-langs, but it feels like a good place for both of them; what do you think? I probably put _supports_spellcheck in ephy-langs because it was needed from the preferences dialog for an earlier iteration of the patch.

Anyway, we shouldn't commit anything here until we have a story for installation of missing dictionaries. I can handle this once we decide what, if any, API we will add to WebKit.
Comment 5 Michael Catanzaro 2015-02-03 16:16:04 UTC
The problem is this: in Epiphany we have an Add Language dialog under Preferences -> Language -> Add. The language selected here will be sent in HTTP headers to suggest web sites send a page in that language. (You can actually add multiple languages, and it will be sent as a list of preferences.) It MAY also be used for spell checking (for which you can also have multiple languages), but the set of languages we want to support for HTTP headers is larger than the set with spell checking dictionaries available. In particular, generic languages like "English" will never support spell checking; spell checking is only possibly available for specific locales like "English (United States)". But we want to let the user pick the generic language anyway, especially since there are generic languages with no corresponding specific locales, like Abkhazian.

Of course, some specific locales may not support spell checking at all, either. And for others, spell checking may be supported but with no way to install a spell checking dictionary. So this is a pretty confusing situation. Currently we just silently fail if there is no spell checking dictionary installed for the language the user picked, but we should do better. If you have any suggestions on how our UI could help the user navigate through this, that would be great.
Comment 6 Michael Catanzaro 2015-02-03 16:19:52 UTC
Another option would be to give up on using the same list of languages for both HTTP headers and spell checking, and have separate UI for these. It feels simpler to have just one list, but maybe it's not really.
Comment 7 GNOME Infrastructure Team 2018-08-03 20:23:39 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/epiphany/issues/254.