New option --no-wrap.

This commit is contained in:
Bruno Haible 2002-04-23 11:37:42 +00:00
parent bd4e6e4c87
commit f5afb1e300
28 changed files with 198 additions and 3 deletions

View File

@ -1,3 +1,7 @@
2002-04-23 Bruno Haible <bruno@clisp.org>
* msg*.texi, xgettext.texi: Document option --no-wrap.
2002-04-22 Bruno Haible <bruno@clisp.org>
* gettext.texi (Preparing Strings): New section.

View File

@ -144,6 +144,12 @@ Set the output page width. Long strings in the output files will be
split across multiple lines in order to ensure that each line's width
(= number of screen columns) is less or equal to the given @var{number}.
@item --no-wrap
@opindex --no-wrap@r{, @code{msgattrib} option}
Do not break long message lines. Message lines whose width exceeds the
output page width will not be split into several lines. Only file reference
lines which are wider than the output page width will be split.
@item -s
@itemx --sort-output
@opindex -s@r{, @code{msgattrib} option}

View File

@ -132,6 +132,12 @@ Set the output page width. Long strings in the output files will be
split across multiple lines in order to ensure that each line's width
(= number of screen columns) is less or equal to the given @var{number}.
@item --no-wrap
@opindex --no-wrap@r{, @code{msgcat} option}
Do not break long message lines. Message lines whose width exceeds the
output page width will not be split into several lines. Only file reference
lines which are wider than the output page width will be split.
@item -s
@itemx --sort-output
@opindex -s@r{, @code{msgcat} option}

View File

@ -119,6 +119,12 @@ Set the output page width. Long strings in the output files will be
split across multiple lines in order to ensure that each line's width
(= number of screen columns) is less or equal to the given @var{number}.
@item --no-wrap
@opindex --no-wrap@r{, @code{msgcomm} option}
Do not break long message lines. Message lines whose width exceeds the
output page width will not be split into several lines. Only file reference
lines which are wider than the output page width will be split.
@item -s
@itemx --sort-output
@opindex -s@r{, @code{msgcomm} option}

View File

@ -90,6 +90,12 @@ Set the output page width. Long strings in the output files will be
split across multiple lines in order to ensure that each line's width
(= number of screen columns) is less or equal to the given @var{number}.
@item --no-wrap
@opindex --no-wrap@r{, @code{msgconv} option}
Do not break long message lines. Message lines whose width exceeds the
output page width will not be split into several lines. Only file reference
lines which are wider than the output page width will be split.
@item -s
@itemx --sort-output
@opindex -s@r{, @code{msgconv} option}

View File

@ -83,6 +83,12 @@ Set the output page width. Long strings in the output files will be
split across multiple lines in order to ensure that each line's width
(= number of screen columns) is less or equal to the given @var{number}.
@item --no-wrap
@opindex --no-wrap@r{, @code{msgen} option}
Do not break long message lines. Message lines whose width exceeds the
output page width will not be split into several lines. Only file reference
lines which are wider than the output page width will be split.
@item -s
@itemx --sort-output
@opindex -s@r{, @code{msgen} option}

View File

@ -135,6 +135,12 @@ Set the output page width. Long strings in the output files will be
split across multiple lines in order to ensure that each line's width
(= number of screen columns) is less or equal to the given @var{number}.
@item --no-wrap
@opindex --no-wrap@r{, @code{msgfilter} option}
Do not break long message lines. Message lines whose width exceeds the
output page width will not be split into several lines. Only file reference
lines which are wider than the output page width will be split.
@item -s
@itemx --sort-output
@opindex -s@r{, @code{msgfilter} option}

View File

@ -162,6 +162,12 @@ Set the output page width. Long strings in the output files will be
split across multiple lines in order to ensure that each line's width
(= number of screen columns) is less or equal to the given @var{number}.
@item --no-wrap
@opindex --no-wrap@r{, @code{msggrep} option}
Do not break long message lines. Message lines whose width exceeds the
output page width will not be split into several lines. Only file reference
lines which are wider than the output page width will be split.
@item --sort-output
@opindex --sort-output@r{, @code{msggrep} option}
Generate sorted output. Note that using this option makes it much harder

View File

@ -62,6 +62,12 @@ Set the output page width. Long strings in the output files will be
split across multiple lines in order to ensure that each line's width
(= number of screen columns) is less or equal to the given @var{number}.
@item --no-wrap
@opindex --no-wrap@r{, @code{msginit} option}
Do not break long message lines. Message lines whose width exceeds the
output page width will not be split into several lines. Only file reference
lines which are wider than the output page width will be split.
@end table
@subsection Informative output

View File

@ -159,6 +159,12 @@ Set the output page width. Long strings in the output files will be
split across multiple lines in order to ensure that each line's width
(= number of screen columns) is less or equal to the given @var{number}.
@item --no-wrap
@opindex --no-wrap@r{, @code{msgmerge} option}
Do not break long message lines. Message lines whose width exceeds the
output page width will not be split into several lines. Only file reference
lines which are wider than the output page width will be split.
@item -s
@itemx --sort-output
@opindex -s@r{, @code{msgmerge} option}

View File

@ -118,6 +118,12 @@ Set the output page width. Long strings in the output files will be
split across multiple lines in order to ensure that each line's width
(= number of screen columns) is less or equal to the given @var{number}.
@item --no-wrap
@opindex --no-wrap@r{, @code{msgunfmt} option}
Do not break long message lines. Message lines whose width exceeds the
output page width will not be split into several lines. Only file reference
lines which are wider than the output page width will be split.
@item -s
@itemx --sort-output
@opindex -s@r{, @code{msgunfmt} option}

View File

@ -116,6 +116,12 @@ Set the output page width. Long strings in the output files will be
split across multiple lines in order to ensure that each line's width
(= number of screen columns) is less or equal to the given @var{number}.
@item --no-wrap
@opindex --no-wrap@r{, @code{msguniq} option}
Do not break long message lines. Message lines whose width exceeds the
output page width will not be split into several lines. Only file reference
lines which are wider than the output page width will be split.
@item -s
@itemx --sort-output
@opindex -s@r{, @code{msguniq} option}

View File

@ -204,6 +204,12 @@ Set the output page width. Long strings in the output files will be
split across multiple lines in order to ensure that each line's width
(= number of screen columns) is less or equal to the given @var{number}.
@item --no-wrap
@opindex --no-wrap@r{, @code{xgettext} option}
Do not break long message lines. Message lines whose width exceeds the
output page width will not be split into several lines. Only file reference
lines which are wider than the output page width will be split.
@item -s
@itemx --sort-output
@opindex -s@r{, @code{xgettext} option}

View File

@ -1,3 +1,24 @@
2002-04-23 Bruno Haible <bruno@clisp.org>
* write-po.h (message_page_width_ignore): New declaration.
* write-po.c (wrap_strings): New variable.
(message_page_width_ignore): New function.
(wrap): Ignore the do_wrap argument if wrap_strings is false.
* msgattrib.c (long_options): Add --no-wrap option.
(main): Handle option --no-wrap.
(usage): Document option --no-wrap.
* msgcat.c: Likewise.
* msgcomm.c: Likewise.
* msgconv.c: Likewise.
* msgen.c: Likewise.
* msgfilter.c: Likewise.
* msggrep.c: Likewise.
* msginit.c: Likewise.
* msgmerge.c: Likewise.
* msgunfmt.c: Likewise.
* msguniq.c: Likewise.
* xgettext.c: Likewise.
2002-04-19 Bruno Haible <bruno@clisp.org>
* msginit.c (catalogname_for_locale): Add wa_BE. Change Javanese from

View File

@ -81,6 +81,7 @@ static const struct option long_options[] =
{ "no-fuzzy", no_argument, NULL, CHAR_MAX + 3 },
{ "no-location", no_argument, &line_comment, 0 },
{ "no-obsolete", no_argument, NULL, CHAR_MAX + 5 },
{ "no-wrap", no_argument, NULL, CHAR_MAX + 13 },
{ "obsolete", no_argument, NULL, CHAR_MAX + 12 },
{ "only-fuzzy", no_argument, NULL, CHAR_MAX + 4 },
{ "only-obsolete", no_argument, NULL, CHAR_MAX + 6 },
@ -251,6 +252,10 @@ main (argc, argv)
to_change |= RESET_OBSOLETE;
break;
case CHAR_MAX + 13: /* --no-wrap */
message_page_width_ignore ();
break;
default:
usage (EXIT_FAILURE);
/* NOTREACHED */
@ -388,6 +393,8 @@ Output details:\n\
-n, --add-location generate '#: filename:line' lines (default)\n\
--strict write out strict Uniforum conforming .po file\n\
-w, --width=NUMBER set output page width\n\
--no-wrap do not break long message lines, longer than\n\
the output page width, into several lines\n\
-s, --sort-output generate sorted output\n\
-F, --sort-by-file sort output by file location\n\
"));

View File

@ -61,6 +61,7 @@ static const struct option long_options[] =
{ "indent", no_argument, NULL, 'i' },
{ "no-escape", no_argument, NULL, 'e' },
{ "no-location", no_argument, &line_comment, 0 },
{ "no-wrap", no_argument, NULL, CHAR_MAX + 2 },
{ "output-file", required_argument, NULL, 'o' },
{ "sort-by-file", no_argument, NULL, 'F' },
{ "sort-output", no_argument, NULL, 's' },
@ -216,6 +217,10 @@ main (argc, argv)
use_first = true;
break;
case CHAR_MAX + 2: /* --no-wrap */
message_page_width_ignore ();
break;
default:
usage (EXIT_FAILURE);
/* NOTREACHED */
@ -357,6 +362,8 @@ Output details:\n\
-n, --add-location generate '#: filename:line' lines (default)\n\
--strict write out strict Uniforum conforming .po file\n\
-w, --width=NUMBER set output page width\n\
--no-wrap do not break long message lines, longer than\n\
the output page width, into several lines\n\
-s, --sort-output generate sorted output\n\
-F, --sort-by-file sort output by file location\n\
"));

View File

@ -63,6 +63,7 @@ static const struct option long_options[] =
{ "indent", no_argument, NULL, 'i' },
{ "no-escape", no_argument, NULL, 'e' },
{ "no-location", no_argument, &line_comment, 0 },
{ "no-wrap", no_argument, NULL, CHAR_MAX + 2 },
{ "omit-header", no_argument, NULL, CHAR_MAX + 1 },
{ "output", required_argument, NULL, 'o' }, /* for backward compatibility */
{ "output-file", required_argument, NULL, 'o' },
@ -219,6 +220,10 @@ main (argc, argv)
omit_header = true;
break;
case CHAR_MAX + 2: /* --no-wrap */
message_page_width_ignore ();
break;
default:
usage (EXIT_FAILURE);
/* NOTREACHED */
@ -369,6 +374,8 @@ Output details:\n\
-n, --add-location generate '#: filename:line' lines (default)\n\
--strict write out strict Uniforum conforming .po file\n\
-w, --width=NUMBER set output page width\n\
--no-wrap do not break long message lines, longer than\n\
the output page width, into several lines\n\
-s, --sort-output generate sorted output\n\
-F, --sort-by-file sort output by file location\n\
--omit-header don't write header with `msgid \"\"' entry\n\

View File

@ -22,6 +22,7 @@
#endif
#include <getopt.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <locale.h>
@ -59,6 +60,7 @@ static const struct option long_options[] =
{ "indent", no_argument, NULL, 'i' },
{ "no-escape", no_argument, NULL, 'e' },
{ "no-location", no_argument, &line_comment, 0 },
{ "no-wrap", no_argument, NULL, CHAR_MAX + 1 },
{ "output-file", required_argument, NULL, 'o' },
{ "sort-by-file", no_argument, NULL, 'F' },
{ "sort-output", no_argument, NULL, 's' },
@ -169,6 +171,10 @@ main (argc, argv)
}
break;
case CHAR_MAX + 1: /* --no-wrap */
message_page_width_ignore ();
break;
default:
usage (EXIT_FAILURE);
break;
@ -291,6 +297,8 @@ Output details:\n\
--add-location preserve '#: filename:line' lines (default)\n\
--strict strict Uniforum output style\n\
-w, --width=NUMBER set output page width\n\
--no-wrap do not break long message lines, longer than\n\
the output page width, into several lines\n\
-s, --sort-output generate sorted output\n\
-F, --sort-by-file sort output by file location\n\
"));

View File

@ -22,6 +22,7 @@
#endif
#include <getopt.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <locale.h>
@ -54,6 +55,7 @@ static const struct option long_options[] =
{ "indent", no_argument, NULL, 'i' },
{ "no-escape", no_argument, NULL, 'e' },
{ "no-location", no_argument, &line_comment, 0 },
{ "no-wrap", no_argument, NULL, CHAR_MAX + 1 },
{ "output-file", required_argument, NULL, 'o' },
{ "sort-by-file", no_argument, NULL, 'F' },
{ "sort-output", no_argument, NULL, 's' },
@ -157,6 +159,10 @@ main (argc, argv)
}
break;
case CHAR_MAX + 1: /* --no-wrap */
message_page_width_ignore ();
break;
default:
usage (EXIT_FAILURE);
break;
@ -272,6 +278,8 @@ Output details:\n\
--add-location preserve '#: filename:line' lines (default)\n\
--strict strict Uniforum output style\n\
-w, --width=NUMBER set output page width\n\
--no-wrap do not break long message lines, longer than\n\
the output page width, into several lines\n\
-s, --sort-output generate sorted output\n\
-F, --sort-by-file sort output by file location\n\
"));

View File

@ -101,6 +101,7 @@ static const struct option long_options[] =
{ "keep-header", no_argument, &keep_header, 1 },
{ "no-escape", no_argument, NULL, CHAR_MAX + 2 },
{ "no-location", no_argument, &line_comment, 0 },
{ "no-wrap", no_argument, NULL, CHAR_MAX + 3 },
{ "output-file", required_argument, NULL, 'o' },
{ "sort-by-file", no_argument, NULL, 'F' },
{ "sort-output", no_argument, NULL, 's' },
@ -235,6 +236,10 @@ main (argc, argv)
message_print_style_escape (false);
break;
case CHAR_MAX + 3: /* --no-wrap */
message_page_width_ignore ();
break;
default:
usage (EXIT_FAILURE);
break;
@ -405,6 +410,8 @@ Output details:\n\
--add-location preserve '#: filename:line' lines (default)\n\
--strict strict Uniforum output style\n\
-w, --width=NUMBER set output page width\n\
--no-wrap do not break long message lines, longer than\n\
the output page width, into several lines\n\
-s, --sort-output generate sorted output\n\
-F, --sort-by-file sort output by file location\n\
"));

View File

@ -94,6 +94,7 @@ static const struct option long_options[] =
{ "msgstr", no_argument, NULL, 'T' },
{ "no-escape", no_argument, NULL, CHAR_MAX + 3 },
{ "no-location", no_argument, &line_comment, 0 },
{ "no-wrap", no_argument, NULL, CHAR_MAX + 6 },
{ "output-file", required_argument, NULL, 'o' },
{ "regexp", required_argument, NULL, 'e' },
{ "sort-by-file", no_argument, NULL, CHAR_MAX + 4 },
@ -273,6 +274,10 @@ main (argc, argv)
sort_by_msgid = true;
break;
case CHAR_MAX + 6: /* --no-wrap */
message_page_width_ignore ();
break;
default:
usage (EXIT_FAILURE);
break;
@ -471,6 +476,8 @@ Output details:\n\
--add-location preserve '#: filename:line' lines (default)\n\
--strict strict Uniforum output style\n\
-w, --width=NUMBER set output page width\n\
--no-wrap do not break long message lines, longer than\n\
the output page width, into several lines\n\
--sort-output generate sorted output\n\
--sort-by-file sort output by file location\n\
"));

View File

@ -116,6 +116,7 @@ static const struct option long_options[] =
{ "input", required_argument, NULL, 'i' },
{ "locale", required_argument, NULL, 'l' },
{ "no-translator", no_argument, NULL, CHAR_MAX + 1 },
{ "no-wrap", no_argument, NULL, CHAR_MAX + 2 },
{ "output-file", required_argument, NULL, 'o' },
{ "version", no_argument, NULL, 'V' },
{ "width", required_argument, NULL, 'w' },
@ -238,6 +239,10 @@ main (argc, argv)
no_translator = true;
break;
case CHAR_MAX + 2: /* --no-wrap */
message_page_width_ignore ();
break;
default:
usage (EXIT_FAILURE);
break;
@ -381,6 +386,8 @@ Output details:\n\
-l, --locale=LL_CC set target locale\n\
--no-translator assume the PO file is automatically generated\n\
-w, --width=NUMBER set output page width\n\
--no-wrap do not break long message lines, longer than\n\
the output page width, into several lines\n\
"));
printf ("\n");
/* xgettext: no-wrap */

View File

@ -87,6 +87,7 @@ static const struct option long_options[] =
{ "multi-domain", no_argument, NULL, 'm' },
{ "no-escape", no_argument, NULL, 'e' },
{ "no-location", no_argument, &line_comment, 0 },
{ "no-wrap", no_argument, NULL, CHAR_MAX + 4 },
{ "output-file", required_argument, NULL, 'o' },
{ "quiet", no_argument, NULL, 'q' },
{ "sort-by-file", no_argument, NULL, 'F' },
@ -252,6 +253,10 @@ main (argc, argv)
backup_suffix_string = optarg;
break;
case CHAR_MAX + 4: /* --no-wrap */
message_page_width_ignore ();
break;
default:
usage (EXIT_FAILURE);
break;
@ -462,6 +467,8 @@ Output details:\n\
--add-location preserve '#: filename:line' lines (default)\n\
--strict strict Uniforum output style\n\
-w, --width=NUMBER set output page width\n\
--no-wrap do not break long message lines, longer than\n\
the output page width, into several lines\n\
-s, --sort-output generate sorted output\n\
-F, --sort-by-file sort output by file location\n\
"));

View File

@ -68,6 +68,7 @@ static const struct option long_options[] =
{ "java", no_argument, NULL, 'j' },
{ "locale", required_argument, NULL, 'l' },
{ "no-escape", no_argument, NULL, 'e' },
{ "no-wrap", no_argument, NULL, CHAR_MAX + 2 },
{ "output-file", required_argument, NULL, 'o' },
{ "resource", required_argument, NULL, 'r' },
{ "sort-output", no_argument, NULL, 's' },
@ -186,6 +187,10 @@ main (argc, argv)
tcl_mode = true;
break;
case CHAR_MAX + 2: /* --no-wrap */
message_page_width_ignore ();
break;
default:
usage (EXIT_FAILURE);
break;
@ -374,6 +379,8 @@ Output details:\n\
-i, --indent write indented output style\n\
--strict write strict uniforum style\n\
-w, --width=NUMBER set output page width\n\
--no-wrap do not break long message lines, longer than\n\
the output page width, into several lines\n\
-s, --sort-output generate sorted output\n\
"));
printf ("\n");

View File

@ -59,6 +59,7 @@ static const struct option long_options[] =
{ "indent", no_argument, NULL, 'i' },
{ "no-escape", no_argument, NULL, 'e' },
{ "no-location", no_argument, &line_comment, 0 },
{ "no-wrap", no_argument, NULL, CHAR_MAX + 2 },
{ "output-file", required_argument, NULL, 'o' },
{ "repeated", no_argument, NULL, 'd' },
{ "sort-by-file", no_argument, NULL, 'F' },
@ -194,6 +195,10 @@ main (argc, argv)
use_first = true;
break;
case CHAR_MAX + 2: /* --no-wrap */
message_page_width_ignore ();
break;
default:
usage (EXIT_FAILURE);
/* NOTREACHED */
@ -329,6 +334,8 @@ Output details:\n\
-n, --add-location generate '#: filename:line' lines (default)\n\
--strict write out strict Uniforum conforming .po file\n\
-w, --width=NUMBER set output page width\n\
--no-wrap do not break long message lines, longer than\n\
the output page width, into several lines\n\
-s, --sort-output generate sorted output\n\
-F, --sort-by-file sort output by file location\n\
"));

View File

@ -103,6 +103,18 @@ message_page_width_set (n)
}
/* This variable controls the extent to which the page width applies.
True means it applies to message strings and file reference lines.
False means it applies to file reference lines only. */
static bool wrap_strings = true;
void
message_page_width_ignore ()
{
wrap_strings = false;
}
/* These three variables control the output style of the message_print
function. Interface functions for them are to be used. */
static bool indent = false;
@ -487,7 +499,7 @@ internationalized messages should not contain the `\\%c' escape sequence"),
startcol_after_break++;
/* The line width. Allow room for the closing quote character. */
width = (do_wrap == no ? INT_MAX : page_width) - 1;
width = (wrap_strings && do_wrap != no ? page_width : INT_MAX) - 1;
/* Adjust for indentation of subsequent lines. */
width -= startcol_after_break;

View File

@ -1,5 +1,5 @@
/* GNU gettext - internationalization aids
Copyright (C) 1995-1998, 2000, 2001 Free Software Foundation, Inc.
Copyright (C) 1995-1998, 2000-2002 Free Software Foundation, Inc.
This file was written by Peter Miller <millerp@canb.auug.org.au>
@ -26,7 +26,8 @@
extern void
message_page_width_set PARAMS ((size_t width));
extern void
message_page_width_ignore PARAMS ((void));
extern void
message_print_style_indent PARAMS ((void));
extern void

View File

@ -135,6 +135,7 @@ static const struct option long_options[] =
{ "msgstr-suffix", optional_argument, NULL, 'M' },
{ "no-escape", no_argument, NULL, 'e' },
{ "no-location", no_argument, &line_comment, 0 },
{ "no-wrap", no_argument, NULL, CHAR_MAX + 3 },
{ "omit-header", no_argument, &xgettext_omit_header, 1 },
{ "output", required_argument, NULL, 'o' },
{ "output-dir", required_argument, NULL, 'p' },
@ -361,6 +362,9 @@ main (argc, argv)
case CHAR_MAX + 2: /* --foreign-user */
copyright_holder = "";
break;
case CHAR_MAX + 3: /* --no-wrap */
message_page_width_ignore ();
break;
default:
usage (EXIT_FAILURE);
/* NOTREACHED */
@ -601,6 +605,8 @@ Output details:\n\
-n, --add-location generate '#: filename:line' lines (default)\n\
--strict write out strict Uniforum conforming .po file\n\
-w, --width=NUMBER set output page width\n\
--no-wrap do not break long message lines, longer than\n\
the output page width, into several lines\n\
-s, --sort-output generate sorted output\n\
-F, --sort-by-file sort output by file location\n\
--omit-header don't write header with `msgid \"\"' entry\n\