diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rwxr-xr-x | lib/ephy-spell-check.c | 18 |
2 files changed, 19 insertions, 5 deletions
@@ -1,3 +1,9 @@ +2006-07-24 Jean-François Rameau <jframeau@cvs.gnome.org> + + * lib/ephy-spell-check.c: (ephy_spell_check_init): + + Set default dictionary based on applicable locale names. + 2006-07-24 Christian Persch <chpe@cvs.gnome.org> * data/glade/certificate-dialogs.glade: 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 +} |