aboutsummaryrefslogtreecommitdiffstats
path: root/src/prefs-dialog.c
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2004-11-07 23:38:41 +0800
committerChristian Persch <chpe@src.gnome.org>2004-11-07 23:38:41 +0800
commit7c1faa92b84f4feac0cf5f82e16fb8326598a3ae (patch)
tree25077fc3d3799fdd7616d86a2ddff1255a8f219e /src/prefs-dialog.c
parent9f4b8495af0a6305d442fbcd81085ecfcca80001 (diff)
downloadgsoc2013-epiphany-7c1faa92b84f4feac0cf5f82e16fb8326598a3ae.tar.gz
gsoc2013-epiphany-7c1faa92b84f4feac0cf5f82e16fb8326598a3ae.tar.zst
gsoc2013-epiphany-7c1faa92b84f4feac0cf5f82e16fb8326598a3ae.zip
Show language code in the string in languages editor. Fixes bug #115355.
2004-11-07 Christian Persch <chpe@cvs.gnome.org> * data/epiphany.schemas.in: * embed/mozilla/mozilla-notifiers.cpp: * lib/ephy-langs.c: (ephy_font_n_languages), (ephy_langs_sanitise), (ephy_langs_append_languages), (ephy_langs_get_languages): * lib/ephy-langs.h: * src/prefs-dialog.c: (add_system_language_entry), (setup_add_language_dialog), (create_language_section): Show language code in the string in languages editor. Fixes bug #115355.
Diffstat (limited to 'src/prefs-dialog.c')
-rw-r--r--src/prefs-dialog.c56
1 files changed, 43 insertions, 13 deletions
diff --git a/src/prefs-dialog.c b/src/prefs-dialog.c
index 06d3cb1f0..9fdf34a73 100644
--- a/src/prefs-dialog.c
+++ b/src/prefs-dialog.c
@@ -94,14 +94,6 @@ struct
}
languages [] =
{
- /**
- * please translate like this: "<your language> (System setting)"
- * Examples:
- * "de" translation: "Deutsch (Systemeinstellung)"
- * "en_AU" translation: "English, Australia (System setting)" or
- * "Australian English (System setting)"
- */
- { N_("System language"), "system" },
{ N_("Afrikaans"), "ak" },
{ N_("Albanian"), "sq" },
{ N_("Arabic"), "ar" },
@@ -777,6 +769,34 @@ add_lang_dialog_response_cb (GtkWidget *widget,
g_object_unref (dialog);
}
+static void
+add_system_language_entry (GtkListStore *store)
+{
+ GtkTreeIter iter;
+ char **sys_langs;
+ char *system, *text;
+ int n_sys_langs;
+
+ sys_langs = ephy_langs_get_languages ();
+ n_sys_langs = g_strv_length (sys_langs);
+
+ system = g_strjoinv (", ", sys_langs);
+
+ text = g_strdup_printf
+ (ngettext (_("System language [%s]"),
+ _("System languages [%s]"), n_sys_langs), system);
+
+ gtk_list_store_append (store, &iter);
+ gtk_list_store_set (store, &iter,
+ COL_LANG_NAME, text,
+ COL_LANG_CODE, "system",
+ -1);
+
+ g_strfreev (sys_langs);
+ g_free (system);
+ g_free (text);
+}
+
static EphyDialog *
setup_add_language_dialog (PrefsDialog *pd)
{
@@ -817,6 +837,8 @@ setup_add_language_dialog (PrefsDialog *pd)
-1);
}
+ add_system_language_entry (store);
+
sortmodel = gtk_tree_model_sort_new_with_model (GTK_TREE_MODEL (store));
gtk_tree_sortable_set_sort_column_id
(GTK_TREE_SORTABLE (sortmodel), COL_LANG_NAME, GTK_SORT_ASCENDING);
@@ -1053,11 +1075,19 @@ create_language_section (EphyDialog *dialog)
/* code isn't in stock list */
if (i == n_languages)
{
- char *text;
-
- text = g_strdup_printf (_("Custom [%s]"), code);
- language_editor_add (pd, code, text);
- g_free (text);
+ if (strcmp (code, "system") != 0)
+ {
+ char *text;
+
+ text = g_strdup_printf (_("Custom [%s]"), code);
+
+ language_editor_add (pd, code, text);
+ g_free (text);
+ }
+ else
+ {
+ add_system_language_entry (store);
+ }
}
else
{