bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Command line parsing of ls, tail and wc with genparse


From: Bruno Haible
Subject: Re: [PATCH] Command line parsing of ls, tail and wc with genparse
Date: Sat, 6 Oct 2007 17:09:15 +0200
User-agent: KMail/1.5.4

Michael Geng wrote:
> My intention is in fact to invoke xgettext on the parser files which 
> genparse generates. ... You can watch the genparse
> generated parser for it from 
> http://genparse.sourceforge.net/examples/wc_clp.c.

OK, this kind of generated code is not bad; it's acceptable to have
translators look at it.

But there are still two problems:

1) The gettext documentation [1] recommends to not make the _() arguments
unnecessarily large.

      printf (_("\
      --files0-from=F    read input from the files specified by\n\
                           NUL-terminated names in file F\n\
  -L, --max-line-length  print the length of the longest line\n\
  -w, --words            print the word counts\n"));

This is too large. When the maintainer adds another option, the translator
should not have to re-proofread the 3 existing options. So you should better
generate code like this:

      printf (_("\
      --files0-from=F    read input from the files specified by\n\
                           NUL-terminated names in file F\n"));
      printf (_("\
  -L, --max-line-length  print the length of the longest line\n"));
      printf (_("\
  -w, --words            print the word counts\n"));


2) What about translator comments? How can a maintainer provide
additional information for the translators? Does this work?

  /* TRANSLATORS: the length here is actually the screen width */
  L / max-line-length  flag    "print the length of the longest line"


/* TRANSLATORS: Keep the colons aligned. */
Usage: __PROGRAM_NAME__ [OPTION]... [FILE]...
  or:  __PROGRAM_NAME__ [OPTION]... --files0-from=F__NEW_PRINT__


Bruno


[1] http://www.gnu.org/software/gettext/manual/html_node/Preparing-Strings.html





reply via email to

[Prev in Thread] Current Thread [Next in Thread]