aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ephy-spell-check.c
diff options
context:
space:
mode:
authorJean-François Rameau <jframeau@cvs.gnome.org>2006-07-25 05:36:03 +0800
committerJean-François Rameau <jframeau@src.gnome.org>2006-07-25 05:36:03 +0800
commitd71cee3e1db02c325c545faca1b0a73c5cd0348d (patch)
treeb8552f3970e51e7b757194b8c126bdc51e631a8a /lib/ephy-spell-check.c
parentafb92cc261edefb15b88b620a4e11255633cd714 (diff)
downloadgsoc2013-epiphany-d71cee3e1db02c325c545faca1b0a73c5cd0348d.tar
gsoc2013-epiphany-d71cee3e1db02c325c545faca1b0a73c5cd0348d.tar.gz
gsoc2013-epiphany-d71cee3e1db02c325c545faca1b0a73c5cd0348d.tar.bz2
gsoc2013-epiphany-d71cee3e1db02c325c545faca1b0a73c5cd0348d.tar.lz
gsoc2013-epiphany-d71cee3e1db02c325c545faca1b0a73c5cd0348d.tar.xz
gsoc2013-epiphany-d71cee3e1db02c325c545faca1b0a73c5cd0348d.tar.zst
gsoc2013-epiphany-d71cee3e1db02c325c545faca1b0a73c5cd0348d.zip
Set default dictionary based on applicable locale names.
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.
Diffstat (limited to 'lib/ephy-spell-check.c')
-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
+}