summaryrefslogtreecommitdiffstats
path: root/info.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2012-10-15 13:29:37 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2012-10-15 13:29:37 -0700
commit7e703b7a1d871a7020605745cb2448ad641fd0ed (patch)
tree044984b6a4f6ad67e37b1ac99fef2d250bf925bc /info.c
parentdc7a831cdee9ca3a713895495cb86129d8279f06 (diff)
downloadsubsurface-7e703b7a1d871a7020605745cb2448ad641fd0ed.tar.gz
Fix incorrect localization of dialog name
The existing code passed a localized copy of a text buffer initialized by a static string to a function that ended up wanting to modify the buffer. Unsurprisingly, that doesn't work. This commit restructures the code so that we initialize the buffer at run time with a localized version of the default string and then just pass the buffer around. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'info.c')
-rw-r--r--info.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/info.c b/info.c
index b1e19e6b0..61a2bebe3 100644
--- a/info.c
+++ b/info.c
@@ -468,11 +468,13 @@ static void dive_trip_widget(GtkWidget *box, dive_trip_t *trip, struct dive_info
static void dive_info_widget(GtkWidget *box, struct dive *dive, struct dive_info *info, gboolean multi)
{
GtkWidget *hbox, *label, *frame, *equipment;
- char buffer[80] = N_("Edit multiple dives");
+ char buffer[80];
+
+ snprintf(buffer, sizeof(buffer), "%s", _("Edit multiple dives"));
if (!multi)
- divename(_(buffer), sizeof(_(buffer)), dive);
- label = gtk_label_new(_(buffer));
+ divename(buffer, sizeof(buffer), dive);
+ label = gtk_label_new(buffer);
gtk_box_pack_start(GTK_BOX(box), label, FALSE, TRUE, 0);
info->location = text_entry(box, _("Location"), location_list, dive->location);