+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.
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}
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}
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}
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}
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}
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}
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
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
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}
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}
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}
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}
+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
{ "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 },
to_change |= RESET_OBSOLETE;
break;
+ case CHAR_MAX + 13: /* --no-wrap */
+ message_page_width_ignore ();
+ break;
+
default:
usage (EXIT_FAILURE);
/* NOTREACHED */
-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\
"));
{ "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' },
use_first = true;
break;
+ case CHAR_MAX + 2: /* --no-wrap */
+ message_page_width_ignore ();
+ break;
+
default:
usage (EXIT_FAILURE);
/* NOTREACHED */
-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\
"));
{ "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' },
omit_header = true;
break;
+ case CHAR_MAX + 2: /* --no-wrap */
+ message_page_width_ignore ();
+ break;
+
default:
usage (EXIT_FAILURE);
/* NOTREACHED */
-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\
#endif
#include <getopt.h>
+#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <locale.h>
{ "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' },
}
break;
+ case CHAR_MAX + 1: /* --no-wrap */
+ message_page_width_ignore ();
+ break;
+
default:
usage (EXIT_FAILURE);
break;
--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\
"));
#endif
#include <getopt.h>
+#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <locale.h>
{ "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' },
}
break;
+ case CHAR_MAX + 1: /* --no-wrap */
+ message_page_width_ignore ();
+ break;
+
default:
usage (EXIT_FAILURE);
break;
--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\
"));
{ "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' },
message_print_style_escape (false);
break;
+ case CHAR_MAX + 3: /* --no-wrap */
+ message_page_width_ignore ();
+ break;
+
default:
usage (EXIT_FAILURE);
break;
--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\
"));
{ "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 },
sort_by_msgid = true;
break;
+ case CHAR_MAX + 6: /* --no-wrap */
+ message_page_width_ignore ();
+ break;
+
default:
usage (EXIT_FAILURE);
break;
--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\
"));
{ "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' },
no_translator = true;
break;
+ case CHAR_MAX + 2: /* --no-wrap */
+ message_page_width_ignore ();
+ break;
+
default:
usage (EXIT_FAILURE);
break;
-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 */
{ "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' },
backup_suffix_string = optarg;
break;
+ case CHAR_MAX + 4: /* --no-wrap */
+ message_page_width_ignore ();
+ break;
+
default:
usage (EXIT_FAILURE);
break;
--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\
"));
{ "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' },
tcl_mode = true;
break;
+ case CHAR_MAX + 2: /* --no-wrap */
+ message_page_width_ignore ();
+ break;
+
default:
usage (EXIT_FAILURE);
break;
-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");
{ "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' },
use_first = true;
break;
+ case CHAR_MAX + 2: /* --no-wrap */
+ message_page_width_ignore ();
+ break;
+
default:
usage (EXIT_FAILURE);
/* NOTREACHED */
-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\
"));
}
+/* 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;
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;
/* 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>
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
{ "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' },
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 */
-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\