[recipes] Stop translating segments in GrIngredientsList
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [recipes] Stop translating segments in GrIngredientsList
- Date: Thu, 4 May 2017 03:31:19 +0000 (UTC)
commit fa787833860814bfdad7b2d651f5e55d158d270a
Author: Matthias Clasen <mclasen redhat com>
Date: Wed May 3 22:31:17 2017 -0400
Stop translating segments in GrIngredientsList
Instead translate segment titles just before displaying them.
src/gr-ingredients-list.c | 2 +-
src/gr-ingredients-viewer.c | 9 ++++++---
src/gr-recipe-formatter.c | 2 +-
src/gr-recipe-printer.c | 2 +-
4 files changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/src/gr-ingredients-list.c b/src/gr-ingredients-list.c
index 0bb05d6..01706e3 100644
--- a/src/gr-ingredients-list.c
+++ b/src/gr-ingredients-list.c
@@ -90,7 +90,7 @@ gr_ingredients_list_populate (GrIngredientsList *ingredients,
amount = fields[0];
unit = fields[1];
ingredient = fields[2];
- segment = (char *)(fields[3][0] ? _(fields[3]) : "");
+ segment = fields[3];
ing = g_new0 (Ingredient, 1);
gr_number_set_fraction (&ing->amount, 0, 0);
diff --git a/src/gr-ingredients-viewer.c b/src/gr-ingredients-viewer.c
index e47ccc8..08d1206 100644
--- a/src/gr-ingredients-viewer.c
+++ b/src/gr-ingredients-viewer.c
@@ -303,11 +303,14 @@ static void
gr_ingredients_viewer_set_title (GrIngredientsViewer *viewer,
const char *title)
{
+ const char *display_title;
+
+ display_title = g_dgettext (GETTEXT_PACKAGE "-data", title);
+ gtk_label_set_label (GTK_LABEL (viewer->title_label), display_title);
+ gtk_entry_set_text (GTK_ENTRY (viewer->title_entry), display_title);
+
g_free (viewer->title);
viewer->title = g_strdup (title);
-
- gtk_label_set_label (GTK_LABEL (viewer->title_label), title);
- gtk_entry_set_text (GTK_ENTRY (viewer->title_entry), title);
}
static void
diff --git a/src/gr-recipe-formatter.c b/src/gr-recipe-formatter.c
index 32ade0e..77de0be 100644
--- a/src/gr-recipe-formatter.c
+++ b/src/gr-recipe-formatter.c
@@ -75,7 +75,7 @@ gr_recipe_format (GrRecipe *recipe)
for (j = 0; segs[j]; j++) {
g_string_append (s, "\n");
if (segs[j][0] != 0)
- g_string_append_printf (s, "* %s *\n", segs[j]);
+ g_string_append_printf (s, "* %s *\n", g_dgettext (GETTEXT_PACKAGE "-data",
segs[j]));
else
g_string_append_printf (s, "* %s *\n", _("Ingredients"));
diff --git a/src/gr-recipe-printer.c b/src/gr-recipe-printer.c
index f5db7b6..2121259 100644
--- a/src/gr-recipe-printer.c
+++ b/src/gr-recipe-printer.c
@@ -185,7 +185,7 @@ begin_print (GtkPrintOperation *operation,
attr->start_index = s->len;
if (segs[j][0] != 0)
- g_string_append (s, segs[j]);
+ g_string_append (s, g_dgettext (GETTEXT_PACKAGE "-data", segs[j]));
else
g_string_append (s, _("Ingredients"));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]