utitilites/pspp-output.c: Deal properly with plural forms
authorJohn Darrington <john@darrington.wattle.id.au>
Sat, 5 Sep 2020 02:31:28 +0000 (04:31 +0200)
committerJohn Darrington <john@darrington.wattle.id.au>
Sat, 5 Sep 2020 02:33:59 +0000 (04:33 +0200)
utilities/pspp-output.c

index c57dda8e6dbd43e0ba75fbeb89c721b9467cdb09..bd4e895f7a0840a5dc1ae0c8979ed7c8728d0bfb 100644 (file)
@@ -1,4 +1,4 @@
-/* PSPP - a program for statistical analysis.
+ /* PSPP - a program for statistical analysis.
    Copyright (C) 2017, 2018 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
@@ -723,14 +723,25 @@ main (int argc, char **argv)
   if (n_args < c->min_args || n_args > c->max_args)
     {
       if (c->min_args == c->max_args)
-        error (1, 0, _("\"%s\" command takes exactly %d argument%s"),
-               c->name, c->min_args, c->min_args ? "s" : "");
+        {
+          error (1, 0,
+                 ngettext ("\"%s\" command takes exactly %d argument",
+                           "\"%s\" command takes exactly %d arguments",
+                           c->min_args), c->name, c->min_args);
+        }
       else if (c->max_args == INT_MAX)
-        error (1, 0, _("\"%s\" command requires at least %d argument%s"),
-               c->name, c->min_args, c->min_args ? "s" : "");
+        {
+          error (1, 0,
+                 ngettext ("\"%s\" command requires at least %d argument",
+                           "\"%s\" command requires at least %d arguments",
+                           c->min_args), c->name, c->min_args);
+        }
       else
-        error (1, 0, _("\"%s\" command requires between %d and %d arguments"),
-               c->name, c->min_args, c->max_args);
+        {
+          error (1, 0,
+                 _("\"%s\" command requires between %d and %d arguments"),
+                 c->name, c->min_args, c->max_args);
+        }
     }
 
   c->run (argc, argv);