[gnome-control-center] keyboard: Pass gettext domain name for GConf entries
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] keyboard: Pass gettext domain name for GConf entries
- Date: Thu, 17 Feb 2011 13:01:02 +0000 (UTC)
commit 029797928d603739ba592a329d06e2d57d43f418
Author: Bastien Nocera <hadess hadess net>
Date: Thu Feb 17 12:25:49 2011 +0000
keyboard: Pass gettext domain name for GConf entries
panels/keyboard/keyboard-shortcuts.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/panels/keyboard/keyboard-shortcuts.c b/panels/keyboard/keyboard-shortcuts.c
index 96df626..6ab61cb 100644
--- a/panels/keyboard/keyboard-shortcuts.c
+++ b/panels/keyboard/keyboard-shortcuts.c
@@ -56,6 +56,7 @@ typedef struct
CcKeyboardItemType type;
char *schema; /* GSettings schema name, if any */
char *description; /* description for GSettings types */
+ char *gettext_package; /* used for GConf type */
char *name; /* GConf key, GConf directory, or GSettings key name depending on type */
int value; /* Value for comparison */
char *key; /* GConf key name for the comparison */
@@ -264,7 +265,7 @@ append_section (GtkBuilder *builder,
switch (keys_list[i].type)
{
case CC_KEYBOARD_ITEM_TYPE_GCONF:
- ret = cc_keyboard_item_load_from_gconf (item, keys_list[i].name);
+ ret = cc_keyboard_item_load_from_gconf (item, keys_list[i].gettext_package, keys_list[i].name);
break;
case CC_KEYBOARD_ITEM_TYPE_GCONF_DIR:
ret = cc_keyboard_item_load_from_gconf_dir (item, keys_list[i].name);
@@ -331,18 +332,18 @@ parse_start_tag (GMarkupParseContext *ctx,
{
KeyList *keylist = (KeyList *) user_data;
KeyListEntry key;
- const char *name, *gconf_key, *schema, *description;
+ const char *name, *gconf_key, *schema, *description, *package;
int value;
Comparison comparison;
name = NULL;
schema = NULL;
+ package = NULL;
/* The top-level element, names the section in the tree */
if (g_str_equal (element_name, "KeyListEntries"))
{
const char *wm_name = NULL;
- const char *package = NULL;
const char *group = NULL;
while (*attr_names && *attr_values)
@@ -388,6 +389,7 @@ parse_start_tag (GMarkupParseContext *ctx,
g_warning ("Duplicate gettext package name");
g_free (keylist->package);
keylist->package = g_strdup (package);
+ bind_textdomain_codeset (keylist->package, "UTF-8");
}
if (group)
{
@@ -440,7 +442,6 @@ parse_start_tag (GMarkupParseContext *ctx,
if (**attr_values) {
if (keylist->package)
{
- bind_textdomain_codeset (keylist->package, "UTF-8");
description = dgettext (keylist->package, *attr_values);
}
else
@@ -476,6 +477,7 @@ parse_start_tag (GMarkupParseContext *ctx,
key.value = value;
key.key = g_strdup (gconf_key);
key.description = g_strdup (description);
+ key.gettext_package = g_strdup (keylist->package);
key.schema = keylist->schema ? g_strdup (keylist->schema) : g_strdup (schema);
key.comparison = comparison;
g_array_append_val (keylist->entries, key);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]