rather than during output.
* libgettextpo library:
- New functions are available for querying the list of supported format
types.
+ - The functions po_message_comments and po_message_extracted_comments
+ return a multiline string where each line no longer starts with a redundant
+ space. The leading space in every comment line is now stripped while
+ reading the PO file.
+ - Conversely, when you pass a multiline string to the function
+ po_message_set_comments or po_message_set_extracted_comments, you normally
+ don't pass a space at the beginning of each line, because such spaces are
+ no longer trimmed during output.
* Documentation:
- The "Users" chapter has been completely rewritten.
+2007-10-21 Bruno Haible <bruno@clisp.org>
+
+ Normalize the leading space of every comment line during input, not
+ during output.
+ * read-catalog-abstract.c (po_callback_comment_dispatcher): Before
+ calling po_callback_comment or po_callback_comment_dot, drop the
+ leading space.
+ * write-po.c (message_print_comment, message_print_comment_dot): Don't
+ remove the leading space of every comment line.
+ * write-stringtable.c (write_message): Likewise.
+ Suggested by Dwayne Bailey <dwayne@translate.org.za>.
+
2007-10-20 Bruno Haible <bruno@clisp.org>
* msgmerge.c (message_merge): Set the fuzzy flag if the msgid_plural
/* Reading PO files, abstract class.
- Copyright (C) 1995-1996, 1998, 2000-2006 Free Software Foundation, Inc.
+ Copyright (C) 1995-1996, 1998, 2000-2007 Free Software Foundation, Inc.
This file was written by Peter Miller <millerp@canb.auug.org.au>
po_callback_comment_dispatcher (const char *s)
{
if (*s == '.')
- po_callback_comment_dot (s + 1);
+ {
+ s++;
+ /* There is usually a space before the comment. People don't
+ consider it part of the comment, therefore remove it here. */
+ if (*s == ' ')
+ s++;
+ po_callback_comment_dot (s);
+ }
else if (*s == ':')
{
/* Parse the file location string. The appropriate callback will be
if (po_parse_comment_solaris_filepos (s))
/* Do nothing, it is a Sun-style file pos line. */ ;
else
- po_callback_comment (s);
+ {
+ /* There is usually a space before the comment. People don't
+ consider it part of the comment, therefore remove it here. */
+ if (*s == ' ')
+ s++;
+ po_callback_comment (s);
+ }
}
}
{
const char *e;
ostream_write_str (stream, "#");
- if (*s != '\0' && *s != ' ')
+ if (*s != '\0')
ostream_write_str (stream, " ");
e = strchr (s, '\n');
if (e == NULL)
{
const char *s = mp->comment_dot->item[j];
ostream_write_str (stream, "#.");
- if (*s != '\0' && *s != ' ')
+ if (*s != '\0')
ostream_write_str (stream, " ");
ostream_write_str (stream, s);
ostream_write_str (stream, "\n");
/* Writing NeXTstep/GNUstep .strings files.
- Copyright (C) 2003, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2006-2007 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2003.
This program is free software: you can redistribute it and/or modify
if (c_strstr (s, "*/") == NULL)
{
ostream_write_str (stream, "/*");
- if (*s != '\0' && *s != '\n' && *s != ' ')
+ if (*s != '\0' && *s != '\n')
ostream_write_str (stream, " ");
ostream_write_str (stream, s);
ostream_write_str (stream, " */\n");
{
const char *e;
ostream_write_str (stream, "//");
- if (*s != '\0' && *s != '\n' && *s != ' ')
+ if (*s != '\0' && *s != '\n')
ostream_write_str (stream, " ");
e = strchr (s, '\n');
if (e == NULL)
{
const char *e;
ostream_write_str (stream, "//");
- if (first || (*s != '\0' && *s != '\n' && *s != ' '))
+ if (first || (*s != '\0' && *s != '\n'))
ostream_write_str (stream, " ");
if (first)
ostream_write_str (stream, "Comment: ");