After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 137431 - Don't split sentences in gstreamer
Don't split sentences in gstreamer
Status: VERIFIED INCOMPLETE
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
0.8.0
Other All
: Normal normal
: 0.8.x
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2004-03-16 22:55 UTC by Christian Rose
Modified: 2009-08-15 18:40 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Christian Rose 2004-03-16 22:55:19 UTC
#: gst/gst.c:133
msgid "')"

#: gst/gst.c:133
msgid "path list for loading plugins (separated by '"
 
#: gst/gst.c:136
msgid "' is the default)"

#: gst/gst.c:136
msgid "Scheduler to use ('"

#: tools/gst-launch.c:79
msgid " ns, min %"

#: tools/gst-launch.c:79
msgid "Execution ended after %"
 
#: tools/gst-launch.c:79
msgid " iterations (sum %"

#: tools/gst-launch.c:79
msgid " ns, average %"
 
#: tools/gst-launch.c:79
msgid " ns, max %"
 
#: tools/gst-launch.c:79
msgid " ns).\n"

Please don't split sentences or language constructs that belong to each
other in several messages. It's a bad, bad, bad thing to do for
translation, as sentences can only be properly translated in full due to
the differences in grammar and word order. See
http://developer.gnome.org/doc/tutorials/gnome-i18n/developer.html#split-sentences
for more details about this type of problem.


#: tools/gst-launch.c:437
#, c-format
msgid "WARNING: erroneous pipeline: %s\n"
 
#: tools/gst-launch.c:438
msgid "         Trying to run anyway.\n"

The spacing in the second message is a mystery, unless one realizes that
the author maybe intended these two messages to line up. These two messages
should perhaps be made one to make that more obvious that they are related
and are intended to line up.


#: gst/gsttag.c:285
msgid ", "

This message is a complete mystery -- a translator comment
(http://developer.gnome.org/doc/tutorials/gnome-i18n/developer.html#use-comments)
 is needed here to make translators know what this message is all about and
how it should be translated.
Comment 1 David Schleef 2004-03-17 00:40:29 UTC
The i18n guide doesn't explain what to do in this situation:

    g_print (_("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);
Comment 2 David Schleef 2004-03-17 02:45:17 UTC
The strings in gst/gst.c are fixed.
Comment 3 Christian Rose 2004-03-17 11:49:59 UTC
Danilo?
Comment 4 Christian Rose 2004-03-17 12:49:47 UTC
The splitup problem also applies to:

#: gst/parse/grammar.y:741
#, c-format
msgid "no element to link URI \"%s\" to"


I guess "to" should be followed by something here, perhaps another
argument. Since some languages need to reorder the arguments here it's
crucial that both arguments are inside the same message.
Comment 5 Christian Rose 2004-03-17 12:50:50 UTC
D'oh, ignore my last comment. I obviously cannot read plain English.
Comment 6 Thomas Vander Stichele 2004-04-13 18:39:32 UTC
are there any strings left to which this still applies ? If not we can close
this bug.

(note that there is not really a general solution for this problem)
Comment 7 David Schleef 2004-04-13 21:12:45 UTC
Yes, there are lots of strings to fix still.  Keep this open until someone does
an audit.
Comment 8 Thomas Vander Stichele 2004-07-06 11:26:05 UTC
Christian,

can you explain how, given code like this:

    g_print (_("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);


this situation can be fixed ? I am at loss to figure out what we are supposed to
do here to help translators.  A simple patch for this issue will help me fix others.
Comment 9 Christian Neumair 2004-07-06 16:45:02 UTC
Thomas: Gettext simply can't handle that. What's wrong with simply using %u?

regs,
 Chris
Comment 10 Christian Rose 2004-07-06 20:44:19 UTC
As cneumair already pointed out, you need to use a printf-style approach to
solve this. Gettext simply cannot handle preprocessor constants directly
inserted into strings.
Comment 11 David Schleef 2004-07-06 22:43:19 UTC
There is no printf-style approach.  The problem is that the format string must
be different on various architectures.
Comment 12 Thomas Vander Stichele 2004-07-08 08:08:51 UTC
Christian(s). %u is not portable for 64 bit values.
Comment 13 Thomas Vander Stichele 2004-07-26 10:23:19 UTC
ping, still waiting for ideas for a possible solution
Comment 14 Christian Rose 2004-07-26 22:17:41 UTC
The only possible and remotely clean solution that I see for making this
translatable is with a printf-style approach.

If this currently isn't possible with printf or g_printf for 64-bit values, then
there is no such solution at the moment, I'm afraid.
Comment 15 David Schleef 2004-07-26 23:25:20 UTC
there's no solution at the moment.

I resolved some of these in gst-launch by printing the numbers to strings, and
then printing the string.  It's clumsy, but commented.  I'd prefer to kinder to
the translators than to people reading the code.

Hopefully there won't be too many of these cases.

This bug is waiting for someone (either a developer or a translator) to go
through the message list and propose fixes.
Comment 16 Anders Carlsson 2004-07-27 00:46:50 UTC
Matthias, I remember you saying something about that glib guarantees that the
printf code for 64-bit integers always being lli and llu. Is that so?
Comment 17 Matthias Clasen 2004-07-27 04:41:07 UTC
Here is the ChangeLog entry I was referring to:

2004-05-14  Tor Lillqvist  <tml@iki.fi>

	* glib/gnulib/vasnprintf.c (vasnprintf): Handle empty digit string
	for precision correctly. (#142400)

	For backward compatibility with the Trio implementation, make "ll"
	format modifer work on Win32, too. Change into "I64" before
	passing to the system printf. (#142433)
Comment 18 David Schleef 2004-07-27 05:15:21 UTC
GCC gives a warning if you use %lld and the argument is 'long'.  IIRC, gint64 is
'long' and not 'long long' on 64-bit architectures, even though they're
equivalent.  It's a bug, but I'll let someone else throw the mud to see where it
sticks.
Comment 19 David Schleef 2004-07-27 05:34:20 UTC
Indeed, I just verified this on alpha.
Comment 20 Danilo Segan 2004-08-15 08:36:03 UTC
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)
Comment 21 Christian Fredrik Kalager Schaller 2004-11-25 18:19:11 UTC
Should this bug be reopened or marked as closed?
Comment 22 Christian Fredrik Kalager Schaller 2004-12-07 23:49:55 UTC
No replies so marking closed.
Comment 23 Christian Rose 2004-12-21 13:52:47 UTC
I noticed there was a new pot file (0.8.7pre2) in the Translation Project that
had this problem fixed. Many thanks to all of you who fixed this!