[gstreamer-bugs] [Bug 137431] - Don't split sentences in gstreamer

bugzilla-daemon at bugzilla.gnome.org bugzilla-daemon at bugzilla.gnome.org
Sun Aug 15 01:36:03 PDT 2004


http://bugzilla.gnome.org/show_bug.cgi?id=137431
GStreamer | gstreamer (core) | Ver: 0.8.0





------- Additional Comments From dsegan at gmx.net  2004-08-15 04:36 -------
Another approach to this problem, is if G_GUINT64_FORMAT takes a fixed, known
set of values. According to configure.in I have in my checkout of glib, it can
be one of 8 values currently:
  guint64_format='"u"'
  guint64_format='"lu"'
  3 x  guint64_format='"'$glib_cv_long_long_format'u"'
  3 x  guint64_format='"'$glib_cv_long_long_format'u"'

glib_cv_long_long_format is one of "ll", "q", "I64" (checked in configure.in).

Equipped with this data, you can also use N_() to mark such eight messages for
translators, eg.
/* This is just for xgettext to catch all possible (known?) variants of the
message for translators */
/* */
N_("Execution ended after %u iterations (sum %u ns, average %u ns, min %u ns,
max %u ns).\n");
N_("Execution ended after %lu iterations (sum %lu ns, average %lu ns, min %lu
ns, max %lu ns).\n");
N_("Execution ended after %qu iterations (sum %qu ns, average %qu ns, min %qu
ns, max %qu ns).\n");
....
    g_print (gettext("Execution ended after %" G_GUINT64_FORMAT " iterations (sum %"
            G_GUINT64_FORMAT " ns, average %" G_GUINT64_FORMAT " ns, min %"
            G_GUINT64_FORMAT " ns, max %" G_GUINT64_FORMAT " ns).\n"),
        iterations, sum, sum / iterations, min, max);


Here, translators will get all messages in their entirety, so they won't have
problems translating them (and they're all alike, so gettext-fuzzy matching
would help them do that). Note that I replaced _() call with gettext(), so
xgettext wouldn't catch that message.

The drawback of this is, as everybody probably sees, that number of different
specifiers for G_GUINT64_FORMAT can change, and you'd have to follow glib
changes in that (hard-coding is bad, I agree).  But, the advantage here is that
you keep the code relatively sane, yet help translators translate it efficiently
on most common architectures (all that glib currently supports).  Of course, the 

Note that David's approach of first doing something like:
  char *n_iterations = g_strdup_printf("%" G_GUINT_FORMAT, iterations);
and using "%s" instead in the message (now we get single message to translate),
is nice to translators as well (even better, because translators get one message
to translate).

(sorry for not responding earlier, my gstreamer bugzilla maildir was hidden from
Gnus, and only now I noticed that)


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
You are the QA contact for the bug, or are watching the QA contact.




More information about the Gstreamer-bugs mailing list