[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-gnulib] 4-gary-version-etc-full-author-string.patch
From: |
Gary V. Vaughan |
Subject: |
Re: [Bug-gnulib] 4-gary-version-etc-full-author-string.patch |
Date: |
Fri, 19 Sep 2003 12:28:27 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5b) Gecko/20030903 Thunderbird/0.2 |
Bruno Haible wrote:
Jim Meyering wrote:
How about this (just checked in to coreutils)?
Quite good, nearly perfect. Only this one
+ /* Note that the following must have one `%s' and one `%%s'. */
+#define FMT_TEMPLATE _("Written by %sand %%s.\n")
is not easy to translate for the translator.
Agreed.
I can see three approaches
for fixing it:
a) Extend the switch up to "case 9:" and "case 10:", and simply document
that version_etc works only up to 10 authors.
Only works *well* with up to 10 authors, and after that we fall back to:
Written by: Bruno Haible, Jim Meyering, Paul Eggert, ..., Gary V. Vaughan.
b) In Common Lisp, which has format strings with loops, the format string
would look like "Written by ~{~^~a, ~} and ~a.". So you could devise
an extended_sprintf function that accepts C format with loops.
This would be cool as a gnulib module anyway, whether we use it for
version_etc or not. I should add that to snprintfv at some point :->
c) Let the translator translate
"Written by %s, %s, and %s.\n"
and "Written by %s, %s, %s, and %s.\n"
and at runtime interpolate between the two translations. Like this:
str3 = _("Written by %s, %s, and %s.\n");
str4 = _("Written by %s, %s, %s, and %s.\n");
common_prefix = compute_common_prefix (str3, str4);
str3_suffix = str3 + strlen(common_prefix);
str4_suffix = str4 + strlen(common_suffix);
if (endswith (str4_suffix, str3_suffix))
{
one_element_format =
xstrndup (str4_suffix, strlen(str4_suffix) - strlen(str3_suffix));
final_format_string =
concatenate (common_prefix,
(N - 3) times one_element_format,
str3_suffix);
...
}
else
/* Use a fallback, possibly just the English thing. */
Ick. Not this one!
Which one do you prefer? I can code it up.
Just to be a PITA, it would be nice to break the list up on word boundaries
with isspace(), or even on a (translatable) user specified delimiter to keep
within 80 columns in the output. We're gonna run out of room around 4 or 5
names otherwise...
Cheers,
Gary.
--
())_. Gary V. Vaughan gary@(lilith.warpmail.net|gnu.org)
( '/ Research Scientist http://www.oranda.demon.co.uk ,_())____
/ )= GNU Hacker http://www.gnu.org/software/libtool \' `&
`(_~)_ Tech' Author http://sources.redhat.com/autobook =`---d__/
- Re: [Bug-gnulib] 4-gary-version-etc-full-author-string.patch, (continued)
- Re: [Bug-gnulib] 4-gary-version-etc-full-author-string.patch, Bruno Haible, 2003/09/17
- Re: [Bug-gnulib] 4-gary-version-etc-full-author-string.patch, Gary V. Vaughan, 2003/09/17
- Re: [Bug-gnulib] 4-gary-version-etc-full-author-string.patch, Jim Meyering, 2003/09/17
- Re: [Bug-gnulib] 4-gary-version-etc-full-author-string.patch, Bruno Haible, 2003/09/18
- Re: [Bug-gnulib] 4-gary-version-etc-full-author-string.patch, Jim Meyering, 2003/09/18
- Re: [Bug-gnulib] 4-gary-version-etc-full-author-string.patch, Paul Eggert, 2003/09/18
- Re: [Bug-gnulib] 4-gary-version-etc-full-author-string.patch, Jim Meyering, 2003/09/18
- Re: [Bug-gnulib] 4-gary-version-etc-full-author-string.patch, Jim Meyering, 2003/09/18
- Re: [Bug-gnulib] 4-gary-version-etc-full-author-string.patch, Bruno Haible, 2003/09/19
- Re: [Bug-gnulib] 4-gary-version-etc-full-author-string.patch, Bruno Haible, 2003/09/19
- Re: [Bug-gnulib] 4-gary-version-etc-full-author-string.patch,
Gary V. Vaughan <=
- Re: [Bug-gnulib] 4-gary-version-etc-full-author-string.patch, Bruno Haible, 2003/09/22
- Re: [Bug-gnulib] 4-gary-version-etc-full-author-string.patch, Gary V. Vaughan, 2003/09/22
- Re: [Bug-gnulib] 4-gary-version-etc-full-author-string.patch, Paul Eggert, 2003/09/22
- Re: [Bug-gnulib] 4-gary-version-etc-full-author-string.patch, Bruno Haible, 2003/09/23
- Re: [Bug-gnulib] 4-gary-version-etc-full-author-string.patch, Paul Eggert, 2003/09/23
- Re: [Bug-gnulib] 4-gary-version-etc-full-author-string.patch, Bruno Haible, 2003/09/23
- Re: [Bug-gnulib] 4-gary-version-etc-full-author-string.patch, Paul Eggert, 2003/09/23
- Re: [Bug-gnulib] 4-gary-version-etc-full-author-string.patch, Bruno Haible, 2003/09/25
- Re: [Bug-gnulib] 4-gary-version-etc-full-author-string.patch, Jim Meyering, 2003/09/25
- Re: [Bug-gnulib] 4-gary-version-etc-full-author-string.patch, Jim Meyering, 2003/09/21