]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Improve checking in the case of absent plural expression.
authorBruno Haible <bruno@clisp.org>
Sat, 20 Oct 2007 19:59:34 +0000 (19:59 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:15:20 +0000 (12:15 +0200)
gettext-tools/src/ChangeLog
gettext-tools/src/msgl-check.c

index 538d5dd8a0d0b978c23ca968b06b450b07b4898a..c6fba9cc95f07a7c5b27bd386098fad1c94d7131 100644 (file)
@@ -1,3 +1,9 @@
+2007-10-20  Bruno Haible  <bruno@clisp.org>
+
+       * msgl-check.c (check_plural): If there is no header entry, or if the
+       header entry does not contain plural= and nplurals=, return a plural
+       distribution corresponding to the Germanic plural.
+
 2007-10-20  Bruno Haible  <bruno@clisp.org>
 
        * format.h (check_msgid_msgstr_format): Add plural_distribution_length
index 0baee307fe43d41c8d1e408f2dbc0f6501ae142f..3da11ff13df13f18eee7706407ee23b7007753e5 100644 (file)
@@ -420,12 +420,22 @@ check_plural (message_list_ty *mlp,
                 max_nplurals = n = min_nplurals.  */
            }
        }
+      else
+       goto no_plural;
     }
-  else if (has_plural != NULL)
+  else
     {
-      po_xerror (PO_SEVERITY_ERROR, has_plural, NULL, 0, 0, false,
-                _("message catalog has plural form translations, but lacks a header entry with \"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\""));
-      seen_errors++;
+      if (has_plural != NULL)
+       {
+         po_xerror (PO_SEVERITY_ERROR, has_plural, NULL, 0, 0, false,
+                    _("message catalog has plural form translations, but lacks a header entry with \"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\""));
+         seen_errors++;
+       }
+     no_plural:
+      /* By default, the Germanic formula (n != 1) is used.  */
+      distribution = XCALLOC (2, unsigned char);
+      distribution[1] = 1;
+      distribution_length = 2;
     }
 
   /* distribution is not needed if we report errors.