]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Emit a warning if the header entry exists but is fuzzy.
authorBruno Haible <bruno@clisp.org>
Wed, 28 Nov 2001 17:03:17 +0000 (17:03 +0000)
committerBruno Haible <bruno@clisp.org>
Sun, 21 Jun 2009 21:27:27 +0000 (23:27 +0200)
src/ChangeLog
src/msgfmt.c

index ec3d761379c3617764e9e115f025ad4f11e9e126..8cb1c7c6972eb0e8742ba16fef2701c5f7b9b145 100644 (file)
@@ -1,3 +1,12 @@
+2001-11-27  Bruno Haible  <bruno@clisp.org>
+
+       * msgfmt.c (struct msgfmt_class_ty): New field
+       'has_nonfuzzy_header_entry'.
+       (format_constructor): Initialize it.
+       (format_debrief): Give a warning if the header entry exists but is
+       fuzzy.
+       (format_directive_message): Update has_nonfuzzy_header_entry.
+
 2001-11-25  Bruno Haible  <bruno@clisp.org>
 
        * x-c.c (comment_start, comment_add, comment_line_end): New inline
index e900180f8d216e9b34c81bd7a6992739de42d902..811f525aa35ed8182012bd8ea44f9a2f3aec64de 100644 (file)
@@ -67,6 +67,7 @@ struct msgfmt_class_ty
   enum is_wrap do_wrap;
 
   bool has_header_entry;
+  bool has_nonfuzzy_header_entry;
 };
 
 /* Contains exit status for case in which no premature exit occurs.  */
@@ -1207,6 +1208,7 @@ format_constructor (that)
     this->is_format[i] = undecided;
   this->do_wrap = undecided;
   this->has_header_entry = false;
+  this->has_nonfuzzy_header_entry = false;
 }
 
 
@@ -1218,14 +1220,29 @@ format_debrief (that)
   msgfmt_class_ty *this = (msgfmt_class_ty *) that;
 
   /* Test whether header entry was found.  */
-  if (check_header && !this->has_header_entry)
+  if (check_header)
     {
-      multiline_error (xasprintf ("%s: ", gram_pos.file_name),
-                      xasprintf (_("\
-warning: PO file header missing, fuzzy, or invalid\n")));
-      multiline_error (NULL,
-                      xasprintf (_("\
+      if (!this->has_header_entry)
+       {
+         multiline_error (xasprintf ("%s: ", gram_pos.file_name),
+                          xasprintf (_("\
+warning: PO file header missing or invalid\n")));
+         multiline_error (NULL,
+                          xasprintf (_("\
 warning: charset conversion will not work\n")));
+       }
+      else if (!this->has_nonfuzzy_header_entry)
+       {
+         /* Has only a fuzzy header entry.  Since the versions 0.10.xx
+            ignore a fuzzy header entry and even give an error on it, we
+            give a warning, to increase operability with these older
+            msgfmt versions.  This warning can go away in January 2003.  */
+         multiline_warning (xasprintf ("%s: ", gram_pos.file_name),
+                            xasprintf (_("warning: PO file header fuzzy\n")));
+         multiline_warning (NULL,
+                            xasprintf (_("\
+warning: older versions of msgfmt will give an error on this\n")));
+       }
     }
 }
 
@@ -1355,6 +1372,8 @@ format_directive_message (that, msgid_string, msgid_pos, msgid_plural,
              if (msgid_string[0] == '\0')
                {
                  this->has_header_entry = true;
+                 if (!this->is_fuzzy)
+                   this->has_nonfuzzy_header_entry = true;
 
                  /* Do some more tests on the contents of the header
                     entry.  */