tAdd webkit language settings - surf - customized build of surf, the suckless w… | |
git clone git://src.adamsgaard.dk/surf | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit 981ade6eeb0f975990b0d336bb6b43e6475d6c40 | |
parent 00f9dcdf439f85df4a2b1efef32e7422a671c26c | |
Author: Quentin Rameau <[email protected]> | |
Date: Sun, 22 Nov 2015 19:13:48 +0100 | |
Add webkit language settings | |
You can now set your prefered website languages in order. | |
It is also possible to enable spell checking in the same way. | |
Diffstat: | |
M config.def.h | 5 +++++ | |
M surf.c | 7 +++++++ | |
2 files changed, 12 insertions(+), 0 deletions(-) | |
--- | |
diff --git a/config.def.h b/config.def.h | |
t@@ -18,6 +18,11 @@ static char *cookiepolicies = "Aa@"; /* A: accept all; a: a… | |
* @: accept no third party */ | |
static int strictssl = 0; /* Refuse untrusted SSL connections */ | |
+/* Languages */ | |
+static int enablespellchecking = 0; | |
+static const char *spellinglanguages[] = { "en_US", NULL }; | |
+static const char *preferedlanguages[] = { NULL }; | |
+ | |
/* Webkit default features */ | |
static int enablescrollbars = 1; | |
static int enablecaretbrowsing = 1; | |
diff --git a/surf.c b/surf.c | |
t@@ -726,6 +726,13 @@ newview(Client *c, WebKitWebView *rv) | |
webkit_cookie_manager_set_accept_policy( | |
webkit_web_context_get_cookie_manager(context), | |
cookiepolicy_get()); | |
+ /* languages */ | |
+ webkit_web_context_set_preferred_languages(context, | |
+ preferedlanguages); | |
+ webkit_web_context_set_spell_checking_languages(context, | |
+ spellinglanguages); | |
+ webkit_web_context_set_spell_checking_enabled(context, | |
+ enablespellchecking); | |
g_signal_connect(G_OBJECT(context), "download-started", | |
G_CALLBACK(downloadstarted), c); |