latest status and plans

Dirk Hohndel dirk at hohndel.org
Sun Oct 14 21:02:35 PDT 2012


Given the fast progress we are making with the localization, I am
changing direction for releases and wider announcements. Instead of
announcing 2.0 with English binaries I am planning to work towards a
version 2.1 that we can release as localized software in a handfull of
languages. I don't plan any more major features - just bug fixes of
things that we found since 2.0 plus the localizations.

I will merge the gettext branch into master this week and hopefully we
can fix the few remaining issues.

So far I have addressed the missing strings that have been spotted and
the problem that in statistics.c the column header strings were designed
in a way that made it extremely hard to translate them correctly in a
number of languages (especially those that modify adjectives depending
on gender of the corresponding noun).

The code change is rather ugly and it adds two new macros to the list of
gettext macros that we use (C_() and NC_()), but this allows us to
provide context to the translators.

diff --git a/statistics.c b/statistics.c
index 06aeb2c..fe37950 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);


The .po files now look like this:

#: statistics.c:168
msgctxt "Depth"
msgid "Average"
msgstr "Ø"

#: statistics.c:165
msgctxt "Duration"
msgid "Average"
msgstr "Ø"

#: statistics.c:171
msgctxt "SAC"
msgid "Average"
msgstr "Ø"

#: statistics.c:174
msgctxt "Temp"
msgid "Average"
msgstr "Ø"

So the same msgid can be translated differenctly, depending on context.

All translators please update your translations. The toolchain tries to
guess the new translations and will certainly get some wrong. All these
guesses are marked with "#, fuzzy" which makes them easy to spot - and
right now our Makefile ignores such entries, so you need to review (and
correct) the translations and then remove the fuzzy comment.

I think what we have works well enough on Linux and Mac. I still haven't
had the time to look into a good solution for the mess on
Windows. That's definitely on the TODO list before creating 2.1

/D


More information about the subsurface mailing list