aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@it.gnome.org>2003-05-11 00:39:11 +0800
committerMarco Pesenti Gritti <mpeseng@src.gnome.org>2003-05-11 00:39:11 +0800
commit781e8b984aea05d4a02f326ed8a99a62bf52996e (patch)
tree7c383382dab4ef2056d0a577dae1a4ee03d97383
parent1a9a315b7f892116319bc5b05323f7d98bbccc36 (diff)
downloadgsoc2013-epiphany-781e8b984aea05d4a02f326ed8a99a62bf52996e.tar
gsoc2013-epiphany-781e8b984aea05d4a02f326ed8a99a62bf52996e.tar.gz
gsoc2013-epiphany-781e8b984aea05d4a02f326ed8a99a62bf52996e.tar.bz2
gsoc2013-epiphany-781e8b984aea05d4a02f326ed8a99a62bf52996e.tar.lz
gsoc2013-epiphany-781e8b984aea05d4a02f326ed8a99a62bf52996e.tar.xz
gsoc2013-epiphany-781e8b984aea05d4a02f326ed8a99a62bf52996e.tar.zst
gsoc2013-epiphany-781e8b984aea05d4a02f326ed8a99a62bf52996e.zip
Use sys language as default
2003-05-10 Marco Pesenti Gritti <marco@it.gnome.org> * data/epiphany.schemas.in: Use sys language as default * data/glade/prefs-dialog.glade: Put back stuff I accidentally removed. * data/glade/print.glade: Set it has hidden in glade, so we can set position before it's showed. * embed/mozilla/mozilla-notifiers.cpp: * src/prefs-dialog.c: Add system language
-rw-r--r--ChangeLog20
-rw-r--r--data/epiphany.schemas.in2
-rw-r--r--data/glade/prefs-dialog.glade158
-rw-r--r--data/glade/print.glade1
-rw-r--r--embed/mozilla/mozilla-notifiers.cpp74
-rw-r--r--src/prefs-dialog.c1
6 files changed, 227 insertions, 29 deletions
diff --git a/ChangeLog b/ChangeLog
index e232920d5..43fe474a3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,26 @@
2003-05-10 Marco Pesenti Gritti <marco@it.gnome.org>
* data/epiphany.schemas.in:
+
+ Use sys language as default
+
+ * data/glade/prefs-dialog.glade:
+
+ Put back stuff I accidentally removed.
+
+ * data/glade/print.glade:
+
+ Set it has hidden in glade, so we can set position
+ before it's showed.
+
+ * embed/mozilla/mozilla-notifiers.cpp:
+ * src/prefs-dialog.c:
+
+ Add system language
+
+2003-05-10 Marco Pesenti Gritti <marco@it.gnome.org>
+
+ * data/epiphany.schemas.in:
* data/glade/prefs-dialog.glade:
* embed/ephy-embed-prefs.h:
* embed/mozilla/mozilla-notifiers.cpp:
diff --git a/data/epiphany.schemas.in b/data/epiphany.schemas.in
index 883f244de..41d7f0a2d 100644
--- a/data/epiphany.schemas.in
+++ b/data/epiphany.schemas.in
@@ -358,7 +358,7 @@
<owner>epiphany</owner>
<type>list</type>
<list_type>string</list_type>
- <default>[en]</default>
+ <default>[system,en]</default>
<locale name="C">
<short>Languages</short>
<long>Preferred languages, two letter codes.</long>
diff --git a/data/glade/prefs-dialog.glade b/data/glade/prefs-dialog.glade
index f97a22444..d6392065f 100644
--- a/data/glade/prefs-dialog.glade
+++ b/data/glade/prefs-dialog.glade
@@ -2727,4 +2727,162 @@
</child>
</widget>
+<widget class="GtkDialog" id="languages_dialog">
+ <property name="border_width">6</property>
+ <property name="height_request">300</property>
+ <property name="title" translatable="yes">Languages editor</property>
+ <property name="type">GTK_WINDOW_TOPLEVEL</property>
+ <property name="window_position">GTK_WIN_POS_NONE</property>
+ <property name="modal">False</property>
+ <property name="resizable">True</property>
+ <property name="destroy_with_parent">False</property>
+ <property name="has_separator">False</property>
+
+ <child internal-child="vbox">
+ <widget class="GtkVBox" id="vbox189">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">0</property>
+
+ <child internal-child="action_area">
+ <widget class="GtkHButtonBox" id="hbuttonbox13">
+ <property name="visible">True</property>
+ <property name="layout_style">GTK_BUTTONBOX_END</property>
+
+ <child>
+ <widget class="GtkButton" id="add_button">
+ <property name="visible">True</property>
+ <property name="can_default">True</property>
+ <property name="can_focus">True</property>
+ <property name="label">gtk-add</property>
+ <property name="use_stock">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="response_id">0</property>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkButton" id="remove_button">
+ <property name="visible">True</property>
+ <property name="can_default">True</property>
+ <property name="can_focus">True</property>
+ <property name="label">gtk-remove</property>
+ <property name="use_stock">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="response_id">0</property>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkButton" id="button12">
+ <property name="visible">True</property>
+ <property name="can_default">True</property>
+ <property name="can_focus">True</property>
+ <property name="label">gtk-close</property>
+ <property name="use_stock">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="response_id">-7</property>
+ <signal name="clicked" handler="language_editor_close_button_cb" last_modification_time="Thu, 16 May 2002 18:58:11 GMT"/>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">GTK_PACK_END</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkVBox" id="vbox190">
+ <property name="border_width">6</property>
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
+
+ <child>
+ <widget class="GtkHBox" id="hbox172">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
+
+ <child>
+ <widget class="GtkLabel" id="label1296">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Language</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkOptionMenu" id="languages_optionmenu">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="history">-1</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkScrolledWindow" id="scrolledwindow1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+ <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+ <property name="shadow_type">GTK_SHADOW_IN</property>
+ <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
+
+ <child>
+ <widget class="GtkTreeView" id="languages_treeview">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="headers_visible">True</property>
+ <property name="rules_hint">False</property>
+ <property name="reorderable">False</property>
+ <property name="enable_search">True</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+</widget>
+
</glade-interface>
diff --git a/data/glade/print.glade b/data/glade/print.glade
index 14af228f8..1e3b71707 100644
--- a/data/glade/print.glade
+++ b/data/glade/print.glade
@@ -6,7 +6,6 @@
<widget class="GtkDialog" id="print_dialog">
<property name="border_width">7</property>
- <property name="visible">True</property>
<property name="title" translatable="yes">Print</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_NONE</property>
diff --git a/embed/mozilla/mozilla-notifiers.cpp b/embed/mozilla/mozilla-notifiers.cpp
index 52b4d2560..fd480ebc0 100644
--- a/embed/mozilla/mozilla-notifiers.cpp
+++ b/embed/mozilla/mozilla-notifiers.cpp
@@ -509,45 +509,65 @@ mozilla_allow_popups_notifier(GConfClient *client,
!new_val);
}
+static char *
+get_system_language ()
+{
+ const GList *sys_langs;
+
+ sys_langs = gnome_i18n_get_language_list ("LC_MESSAGES");
+
+ if (sys_langs)
+ {
+ char *lang = (char *)sys_langs->data;
+
+ /* FIXME this probably need to be smarter */
+ if (strcmp (lang, "C") != 0)
+ {
+ return g_strndup (lang, 2);
+ }
+ }
+
+ return NULL;
+}
+
static void
mozilla_language_notifier(GConfClient *client,
guint cnxn_id,
GConfEntry *entry,
EphyEmbedSingle *single)
{
- gchar *languages;
- GSList *language_list ,*cur_lang_list;
-
- language_list = eel_gconf_get_string_list (CONF_RENDERING_LANGUAGE);
+ GSList *languages, *l;
+ GString *result;
- languages = NULL;
- cur_lang_list = language_list;
- while (cur_lang_list != NULL) {
- char *lang, *tmp;
+ result = g_string_new ("");
+ languages = eel_gconf_get_string_list (CONF_RENDERING_LANGUAGE);
- lang = g_strdup((char *)cur_lang_list->data);
-
- if (languages == NULL)
- languages = lang;
- else {
- tmp = languages;
- languages = g_strconcat(languages, ",", lang, NULL);
- g_free(lang);
- g_free(tmp);
+ for (l = languages; l != NULL; l = l->next)
+ {
+ char *lang = (char *)l->data;
+
+ if (strcmp (lang, "system") == 0)
+ {
+ char *sys_lang;
+
+ sys_lang = get_system_language ();
+ if (sys_lang)
+ {
+ g_string_append (result, sys_lang);
+ g_free (sys_lang);
+ }
+ }
+ else
+ {
+ g_string_append (result, (char *)l->data);
}
- g_free(cur_lang_list->data);
- cur_lang_list = cur_lang_list->next;
- }
- if (languages == NULL)
- {
- languages = g_strdup ("");
+ if (l->next) g_string_append (result, ",");
}
+
+ mozilla_prefs_set_string ("intl.accept_languages", result->str);
- mozilla_prefs_set_string ("intl.accept_languages", languages);
- g_free (languages);
-
- g_slist_free(language_list);
+ g_string_free (result, TRUE);
}
static char *autodetect_charset_prefs[] =
diff --git a/src/prefs-dialog.c b/src/prefs-dialog.c
index 0c02b7fbf..e5dc28c19 100644
--- a/src/prefs-dialog.c
+++ b/src/prefs-dialog.c
@@ -99,6 +99,7 @@ struct
}
languages [] =
{
+ { N_("System language"), "system" },
{ N_("Afrikaans"), "ak" },
{ N_("Albanian"), "sq" },
{ N_("Arabic"), "ar" },