diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2012-10-14 20:43:32 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2012-10-14 20:47:00 -0700 |
commit | f1569a206e58b521fdf4b425b06f8953f4dbdaf3 (patch) | |
tree | dcfdbf951514c88c21528a26a3c6fd06cf9d7834 /statistics.c | |
parent | a3e7a46f1281d07fdbb6deefd992f597fc1bc07b (diff) | |
download | subsurface-f1569a206e58b521fdf4b425b06f8953f4dbdaf3.tar.gz |
Improve translations
- fix two missing strings in equipment.c (thanks to Tommi Saviranta for
pointing this out)
- add context for the translations of the Yearly/monthly statistics. The code
for this ended up being incredibly ugly, but the gettext infrastructure
really clashed with the way this is implemented. What I have now at least
works (tested with the German translation)
- merge the new strings into all the po files. The non-German translations need
to be updated. Make sure you remove the "# , fuzzy" lines or the current
Makefile will ignore those additions.
- some minor cleanup of the po files (many listed the wrong language, all of
them copied my incorrect use of PACKAGE (instead of saying "Subsurface").
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'statistics.c')
-rw-r--r-- | statistics.c | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/statistics.c b/statistics.c index 06aeb2c57..fe379505b 100644 --- a/statistics.c +++ b/statistics.c @@ -156,16 +156,31 @@ static void init_tree() pango_font_description_free(font_desc); renderer = gtk_cell_renderer_text_new (); - char *columns[] = { - N_("Year\n > Month"), "#", N_("Duration\nTotal"), N_("\nAverage"), - N_("\nShortest"), N_("\nLongest"), N_("Depth\nAverage"), N_("\nMinimum"), - N_("\nMaximum"), N_("SAC\nAverage"), N_("\nMinimum"), N_("\nMaximum"), N_("Temperature\nAverage"), - N_("\nMinimum"), N_("\nMaximum") }; + /* don't use empty strings "" - they confuse gettext */ + char *columnstop[] = { N_("Year"), N_("#"), N_("Duration"), " ", " ", " ", N_("Depth"), " ", " ", N_("SAC"), " ", " ", N_("Temperature"), " ", " " }; + const char *columnsbot[15]; + columnsbot[0] = C_("Stats", " > Month"); + columnsbot[1] = " "; + columnsbot[2] = C_("Duration","Total"); + columnsbot[3] = C_("Duration","Average"); + columnsbot[4] = C_("Duration","Shortest"); + columnsbot[5] = C_("Duration","Longest"); + columnsbot[6] = C_("Depth", "Average"); + columnsbot[7] = C_("Depth","Minimum"); + columnsbot[8] = C_("Depth","Maximum"); + columnsbot[9] = C_("SAC","Average"); + columnsbot[10]= C_("SAC","Minimum"); + columnsbot[11]= C_("SAC","Maximum"); + columnsbot[12]= C_("Temp","Average"); + columnsbot[13]= C_("Temp","Minimum"); + columnsbot[14]= C_("Temp","Maximum"); /* Add all the columns to the tree view */ for (i = 0; i < N_COLUMNS; ++i) { + char buf[80]; column = gtk_tree_view_column_new(); - gtk_tree_view_column_set_title(column, _(columns[i])); + snprintf(buf, sizeof(buf), "%s\n%s", _(columnstop[i]), columnsbot[i]); + gtk_tree_view_column_set_title(column, buf); gtk_tree_view_append_column(GTK_TREE_VIEW(yearly_tree), column); renderer = gtk_cell_renderer_text_new(); gtk_tree_view_column_pack_start(column, renderer, TRUE); |