aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rwxr-xr-xlib/ephy-spell-check.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/lib/ephy-spell-check.c b/lib/ephy-spell-check.c
index aa09916fa..b11e585e3 100755
--- a/lib/ephy-spell-check.c
+++ b/lib/ephy-spell-check.c
@@ -54,15 +54,23 @@ static void
ephy_spell_check_init (EphySpellCheck *speller)
{
EphySpellCheckPrivate *priv;
+ const gchar * const *locale;
priv = speller->priv = EPHY_SPELL_CHECK_GET_PRIVATE (speller);
priv->broker = enchant_broker_init ();
- /* FIXME */
- priv->dict = enchant_broker_request_dict (priv->broker, "en");
- if(priv->dict == NULL)
- g_warning(enchant_broker_get_error (priv->broker));
+ /* We don't want to check against C so we get a useful message
+ in case of no available dictionary */
+ for (locale = g_get_language_names ();
+ *locale != NULL && g_ascii_strcasecmp (*locale, "C") != 0;
+ ++locale)
+ {
+ priv->dict = enchant_broker_request_dict (priv->broker, *locale);
+ if (priv->dict != NULL) break;
+ }
+ if (priv->dict == NULL)
+ g_warning (enchant_broker_get_error (priv->broker));
}
static void
@@ -272,4 +280,4 @@ ephy_spell_check_get_language (EphySpellCheck *speller)
enchant_dict_describe (priv->dict, (EnchantDictDescribeFn) describe_cb, &code);
return code;
-} \ No newline at end of file
+}