[Nautilus-list] Ugly hack to mozilla component



This little ugly hack just tries to make the nautilus mozilla component
ask for html documents in the user preferred language (actually the one
in the LANG environment variable)
I have tried it in galician (gl), spanish (es) and without any language
(unset LANG) againts www.google.com and it didn't break anything. So I'm
sending this one to the list...

PD: thanks to everyone from Eazel for the great work done so far.
(really)
Index: components/mozilla/nautilus-mozilla-content-view.c
===================================================================
RCS file: /cvs/gnome/nautilus/components/mozilla/nautilus-mozilla-content-view.c,v
retrieving revision 1.98
diff -p -u -r1.98 nautilus-mozilla-content-view.c
--- components/mozilla/nautilus-mozilla-content-view.c	2001/05/11 01:30:27	1.98
+++ components/mozilla/nautilus-mozilla-content-view.c	2001/05/16 20:27:28
@@ -1897,6 +1897,8 @@ post_widget_initialize (void)
 {
 	static gboolean once = FALSE;
 	char *cache_dir;
+	const char *lang;
+	static char browsing_lang[3];
 	
 	if (once == TRUE) {
 		return;
@@ -1915,6 +1917,14 @@ post_widget_initialize (void)
 
 	/* Setup routing of proxy preferences from gconf to mozilla */
 	mozilla_gconf_listen_for_proxy_changes ();
+
+	/* Set default language for navigation */
+	lang = gnome_i18n_get_language();
+	if (lang != NULL) {
+		memcpy(browsing_lang, lang, 2);
+		browsing_lang[2] = '\0';
+		mozilla_preference_set ("intl.accept_languages", browsing_lang);
+	}
 
 	cache_dir = g_strdup_printf ("%s/.nautilus/MozillaProfile/Cache", g_get_home_dir ());
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]