On Tue, Jan 07, 2025 at 01:36:38PM +0100, Patrice Dumas wrote:
> Hello,
> 
> As I reuse texi2any.pl help message parts in the C main program, I also
> resolve the pending reorganization of the messages to avoid \n in
> translated strings and split each line in a translatable string as far
> as possible as reported by Benno Schulenberg:
>   https://lists.gnu.org/archive/html/bug-texinfo/2021-03/msg00003.html
> 
> There are two blocks remaining, but it is not very clear to me whether
> it is best to split or not. 

It does not really matter one way or another, as far as I am concerned.
Some comments are below:

> First block:
> 
> 
>   The defaults for the @if... conditionals depend on the output format:
>   if generating Docbook, --ifdocbook is on and the others are off;
>   if generating HTML, --ifhtml is on and the others are off;
>   if generating Info, --ifinfo is on and the others are off;
>   if generating plain text, --ifplaintext is on and the others are off;
>   if generating LaTeX, --iflatex is on and the others are off;
>   if generating XML, --ifxml is on and the others are off.

This seems to me to be an explanation of a single idea so could stay
as a single translation block.  It's possible that the same could be
said without repeating every output format.  "--ifhtml is only on by
default when the output format is HTML; likewise for the other output
formats."

There's also duplication from earlier in the message:

  --ifhtml          process @ifhtml and @html even if not generating HTML.

- although this proviso is not given for every format:

  --iflatex         process @iflatex and @latex.

which, if it followed the pattern of the --ifhtml line, would say:

  --iflatex         process @iflatex and @latex even if not generating LaTeX.

So this part of the help message could be condensed in my opinion.  Do
you want to leave me to edit it?

> Second block:
> 
> 
> Examples:
>   makeinfo foo.texi                      write Info to foo's @setfilename
>   makeinfo --html foo.texi               write HTML to @setfilename
>   makeinfo --xml foo.texi                write Texinfo XML to @setfilename
>   makeinfo --docbook foo.texi            write Docbook XML to @setfilename
>   makeinfo --plaintext foo.texi          write plain text to standard output
>   makeinfo --pdf foo.texi                write PDF using texi2dvi
> 
>   makeinfo --html --no-headers foo.texi  write html without node lines, menus
>   makeinfo --number-sections foo.texi    write Info with numbered sections
>   makeinfo --no-split foo.texi           write one Info file however big
> 
> 
> Should I split or not?

It could be fine to split this, as the examples should change to "texi2any"
(or argv[0]; see below) rather than "makeinfo".

These examples are also out of date:

>   makeinfo foo.texi                      write Info to foo's @setfilename

There is no requirement to have a @setfilename line in foo.texi.  I could
edit this as well?

One problem with splitting this by lines is that the first part of each line
is not to be translated, and the translators would have to realise this.  In
theory there can be common variables between the example code and the
description, as in:

$ help2man --help | grep opt-include
 -I, --opt-include=FILE  include material from `FILE' if it exists
$ LANGUAGE=fr help2man --help | grep opt-include
 -I, --opt-include=FICHIER  ajouter du texte depuis « FICHIER »,

so it is not wrong to have the example code included in the translated
string, and this may be simpler and more consistent with the other parts
of the help message.

> (In the second block, I will replace makeinfo by the actual command name,
> so every occurence of makeinfo should be replaced by %s.)

This has the issue that if a long directory path is used to invoke the
program the example might have lines that are too long.

Some programs I checked didn't do it this way:

$ /usr/bin/tar --help | head -n 8
Usage: tar [OPTION...] [FILE]...
GNU 'tar' saves many files together into a single tape or disk archive, and can
restore individual files from the archive.

Examples:
  tar -cf archive.tar foo bar  # Create archive.tar from files foo and bar.
  tar -tvf archive.tar         # List all files in archive.tar verbosely.
  tar -xf archive.tar          # Extract all files from archive.tar.

Note "tar", not "/usr/bin/tar" in the help message.

But also:

$ /usr/bin/bash --help  | grep Type
Type `/usr/bin/bash -c "help set"' for more information about shell options.
Type `/usr/bin/bash -c help' for more information about shell builtin commands.

Reply via email to