diff options
author | Martin Robinson <mrobinson@igalia.com> | 2012-04-21 01:30:32 +0800 |
---|---|---|
committer | martin.james.robinson@gmail.com <mrobinson@igalia.com> | 2012-04-27 03:36:45 +0800 |
commit | 9571561ecfea075e3443e5d7344be8f1ffa9e49e (patch) | |
tree | 98a2d61c8e4005cfa63887fa3260a0c664cdccbc | |
parent | 055a0f01e8ffcb857c1187d13450972dab05cca8 (diff) | |
download | gsoc2013-epiphany-9571561ecfea075e3443e5d7344be8f1ffa9e49e.tar.gz gsoc2013-epiphany-9571561ecfea075e3443e5d7344be8f1ffa9e49e.tar.zst gsoc2013-epiphany-9571561ecfea075e3443e5d7344be8f1ffa9e49e.zip |
Replace "system" with system languages when setting spelling dictionaries
The string "system" is used as a placeholder for the default system
languages in the preference listing of spelling dictionaries. Before
sending this to WebKit to set the spelling dictionaries, we should
fill in the actual default system languages.
-rw-r--r-- | embed/ephy-embed-prefs.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/embed/ephy-embed-prefs.c b/embed/ephy-embed-prefs.c index b1073e385..e16c06602 100644 --- a/embed/ephy-embed-prefs.c +++ b/embed/ephy-embed-prefs.c @@ -386,6 +386,24 @@ webkit_pref_callback_gnome_fonts (GSettings *ephy_settings, } static void +replace_system_language_with_concrete_language_string (char **languages) +{ + int i; + + for (i = 0; i < g_strv_length (languages); i++) { + if (g_str_equal (languages[i], "system")) { + char **sys_langs; + + g_free (languages[i]); + sys_langs = ephy_langs_get_languages (); + languages[i] = g_strjoinv (", ", sys_langs); + + g_strfreev (sys_langs); + } + } +} + +static void webkit_pref_callback_enable_spell_checking (GSettings *settings, char *key, gpointer data) @@ -398,6 +416,7 @@ webkit_pref_callback_enable_spell_checking (GSettings *settings, if (value) { languages = g_settings_get_strv (settings, EPHY_PREFS_WEB_LANGUAGE); + replace_system_language_with_concrete_language_string (languages); langs = g_strjoinv (",", languages); g_strdelimit (langs, "-", '_'); g_strfreev (languages); |