[gtk+] gtk-builder-tool: Simplify non-translatable properties
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] gtk-builder-tool: Simplify non-translatable properties
- Date: Sat, 2 May 2015 21:39:29 +0000 (UTC)
commit 3b0e71cf9b831478b8392402db1337b926994adf
Author: Matthias Clasen <mclasen redhat com>
Date: Sat May 2 14:44:15 2015 -0400
gtk-builder-tool: Simplify non-translatable properties
gtk/gtk-builder-tool.c | 14 +++++++++-----
1 files changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/gtk/gtk-builder-tool.c b/gtk/gtk-builder-tool.c
index 9825190..33a9d12 100644
--- a/gtk/gtk-builder-tool.c
+++ b/gtk/gtk-builder-tool.c
@@ -163,16 +163,19 @@ needs_explicit_setting (MyParserData *data,
static void
maybe_emit_property (MyParserData *data)
{
- gchar *escaped;
gint i;
gboolean bound;
gboolean translatable;
+ gchar *escaped;
bound = FALSE;
translatable = FALSE;
for (i = 0; data->attribute_names[i]; i++)
{
- if (strcmp (data->attribute_names[i], "translatable") == 0)
+ if (strcmp (data->attribute_names[i], "bind-source") == 0 ||
+ strcmp (data->attribute_names[i], "bind_source") == 0)
+ bound = TRUE;
+ else if (strcmp (data->attribute_names[i], "translatable") == 0)
translatable = TRUE;
}
@@ -217,9 +220,10 @@ maybe_emit_property (MyParserData *data)
g_print ("%*s<property", data->indent, "");
for (i = 0; data->attribute_names[i]; i++)
{
- if (strcmp (data->attribute_names[i], "bind-source") == 0 ||
- strcmp (data->attribute_names[i], "bind_source") == 0)
- bound = TRUE;
+ if (!translatable &&
+ (strcmp (data->attributes_name[i], "comments") == 0 ||
+ strcmp (data->attributes_name[i], "context") == 0))
+ continue;
escaped = g_markup_escape_text (data->attribute_values[i], -1);
g_print (" %s=\"%s\"", data->attribute_names[i], escaped);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]