Annotate localizable strings with _(...). From Franc,ois.
authorJim Meyering <jim@meyering.net>
Tue, 8 Aug 1995 04:37:34 +0000 (04:37 +0000)
committerJim Meyering <jim@meyering.net>
Tue, 8 Aug 1995 04:37:34 +0000 (04:37 +0000)
25 files changed:
src/date.c
src/dirname.c
src/echo.c
src/env.c
src/expr.c
src/factor.c
src/hostname.c
src/id.c
src/logname.c
src/nice.c
src/pathchk.c
src/printenv.c
src/printf.c
src/pwd.c
src/seq.c
src/sleep.c
src/stty.c
src/su.c
src/tee.c
src/test.c
src/tty.c
src/uname.c
src/who.c
src/whoami.c
src/yes.c

index d6980d1..5e32afa 100644 (file)
@@ -92,7 +92,7 @@ batch_convert (input_filename, format)
 
   if (strcmp (input_filename, "-") == 0)
     {
-      input_filename = "standard input";
+      input_filename = _("standard input");
       in_stream = stdin;
       have_read_stdin = 1;
     }
@@ -123,7 +123,7 @@ batch_convert (input_filename, format)
        {
          if (line[line_length - 1] == '\n')
            line[line_length - 1] = '\0';
-         error (0, 0, "invalid date `%s'", line);
+         error (0, 0, _("invalid date `%s'"), line);
          status = 1;
        }
       else
@@ -133,7 +133,7 @@ batch_convert (input_filename, format)
     }
 
   if (have_read_stdin && fclose (stdin) == EOF)
-    error (2, errno, "standard input");
+    error (2, errno, _("standard input"));
 
   if (line != NULL)
     free (line);
@@ -196,22 +196,22 @@ main (argc, argv)
   if (set_date && print_date)
     {
       error (0, 0,
-         "the options to print and set the time may not be used together");
+         _("the options to print and set the time may not be used together"));
       usage (1);
     }
 
   if (n_args > 1)
     {
-      error (0, 0, "too many non-option arguments");
+      error (0, 0, _("too many non-option arguments"));
       usage (1);
     }
 
   if ((set_date || print_date || batch_file != NULL)
       && n_args == 1 && argv[optind][0] != '+')
     {
-      error (0, 0, "\
+      error (0, 0, _("\
 when using the print, set time, or batch options, any\n\
-non-option argument must be a format string beginning with `+'");
+non-option argument must be a format string beginning with `+'"));
       usage (1);
     }
 
@@ -219,8 +219,8 @@ non-option argument must be a format string beginning with `+'");
     {
       if (set_date || print_date)
        {
-         error (0, 0, "\
-neither print nor set options may be used when reading dates from a file");
+         error (0, 0, _("\
+neither print nor set options may be used when reading dates from a file"));
          usage (1);
        }
       status = batch_convert (batch_file,
@@ -245,7 +245,7 @@ neither print nor set options may be used when reading dates from a file");
            {
              /* Prepare to print the current date/time.  */
              print_date = 1;
-             datestr = "undefined";
+             datestr = _("undefined");
              time (&when);
              format = (n_args == 1 ? argv[optind] + 1 : NULL);
            }
@@ -258,21 +258,21 @@ neither print nor set options may be used when reading dates from a file");
        }
 
       if (when == -1)
-       error (1, 0, "invalid date `%s'", datestr);
+       error (1, 0, _("invalid date `%s'"), datestr);
 
       if (set_date)
        {
          /* Set the system clock to the specified date, then regardless of
             the success of that operation, format and print that date.  */
          if (stime (&when) == -1)
-           error (0, errno, "cannot set date");
+           error (0, errno, _("cannot set date"));
        }
 
       show_date (format, when);
     }
 
   if (fclose (stdout) == EOF)
-    error (2, errno, "write error");
+    error (2, errno, _("write error"));
 
   exit (status);
 }
@@ -323,16 +323,16 @@ usage (status)
      int status;
 {
   if (status != 0)
-    fprintf (stderr, "Try `%s --help' for more information.\n",
+    fprintf (stderr, _("Try `%s --help' for more information.\n"),
             program_name);
   else
     {
-      printf ("\
+      printf (_("\
 Usage: %s [OPTION]... [+FORMAT]\n\
   or:  %s [OPTION] [MMDDhhmm[[CC]YY][.ss]]\n\
-",
+"),
              program_name, program_name);
-      printf ("\
+      printf (_("\
 Display the current time in the given FORMAT, or set the system date.\n\
 \n\
   -d, --date=STRING        display time described by STRING, not `now'\n\
@@ -341,8 +341,8 @@ Display the current time in the given FORMAT, or set the system date.\n\
   -u, --utc, --universal   print or set Coordinated Universal Time\n\
       --help               display this help and exit\n\
       --version            output version information and exit\n\
-");
-      printf ("\
+"));
+      printf (_("\
 \n\
 FORMAT controls the output.  The only valid option for the second form\n\
 specifies Coordinated Universal Time.  Interpreted sequences are:\n\
@@ -384,7 +384,7 @@ the following modifiers between `%%' and a numeric directive.\n\
 \n\
   `-' (hyphen) do not pad the field\n\
   `_' (underscore) pad the field with spaces\n\
-");
+"));
     }
   exit (status);
 }
index 4386a87..6cb5c9a 100644 (file)
@@ -36,22 +36,22 @@ usage (status)
      int status;
 {
   if (status != 0)
-    fprintf (stderr, "Try `%s --help' for more information.\n",
+    fprintf (stderr, _("Try `%s --help' for more information.\n"),
             program_name);
   else
     {
-      printf ("\
+      printf (_("\
 Usage: %s NAME\n\
   or:  %s OPTION\n\
-",
+"),
              program_name, program_name);
-      printf ("\
+      printf (_("\
 Print NAME with its trailing /component removed; if NAME contains no /'s,\n\
 output `.' (meaning the current directory).\n\
 \n\
   --help      display this help and exit\n\
   --version   output version information and exit\n\
-");
+"));
     }
   exit (status);
 }
@@ -70,7 +70,7 @@ main (argc, argv)
 
   if (argc != 2)
     {
-      error (0, 0, "too %s arguments", argc < 2 ? "few" : "many");
+      error (0, 0, _("too %s arguments"), argc < 2 ? _("few") : _("many"));
       usage (1);
     }
 
index eeafc72..f0b7cd0 100644 (file)
@@ -68,12 +68,12 @@ usage (status)
      int status;
 {
   if (status != 0)
-    fprintf (stderr, "Try `%s --help' for more information.\n",
+    fprintf (stderr, _("Try `%s --help' for more information.\n"),
             program_name);
   else
     {
-      printf ("Usage: %s [OPTION]... [STRING]...\n", program_name);
-      printf ("\
+      printf (_("Usage: %s [OPTION]... [STRING]...\n"), program_name);
+      printf (_("\
 Echo the STRING(s) to standard output.\n\
 \n\
   -n              do not output the trailing newline\n\
@@ -94,7 +94,7 @@ Without -E, the following sequences are recognized and interpolated:\n\
   \\r     carriage return\n\
   \\t     horizontal tab\n\
   \\v     vertical tab\n\
-");
+"));
     }
   exit (status);
 }
index 6537a3c..816b3b8 100644 (file)
--- a/src/env.c
+++ b/src/env.c
@@ -186,13 +186,14 @@ usage (status)
      int status;
 {
   if (status != 0)
-    fprintf (stderr, "Try `%s --help' for more information.\n",
+    fprintf (stderr, _("Try `%s --help' for more information.\n"),
             program_name);
   else
     {
-      printf ("Usage: %s [OPTION]... [-] [NAME=VALUE]... [COMMAND [ARG]...]\n",
+      printf (_("\
+Usage: %s [OPTION]... [-] [NAME=VALUE]... [COMMAND [ARG]...]\n"),
              program_name);
-      printf ("\
+      printf (_("\
 Set each NAME to VALUE in the environment and run COMMAND.\n\
 \n\
   -u, --unset=NAME           remove variable from the environment\n\
@@ -201,7 +202,7 @@ Set each NAME to VALUE in the environment and run COMMAND.\n\
       --version              output version information and exit\n\
 \n\
 A mere - implies -i.  If no COMMAND, print the resulting environment.\n\
-");
+"));
     }
   exit (status);
 }
index 95aba88..d48fade 100644 (file)
@@ -93,22 +93,22 @@ usage (status)
      int status;
 {
   if (status != 0)
-    fprintf (stderr, "Try `%s --help' for more information.\n",
+    fprintf (stderr, _("Try `%s --help' for more information.\n"),
             program_name);
   else
     {
-      printf ("\
+      printf (_("\
 Usage: %s EXPRESSION\n\
   or:  %s OPTION\n\
-",
+"),
              program_name, program_name);
-      printf ("\
+      printf (_("\
 \n\
   --help      display this help and exit\n\
   --version   output version information and exit\n\
 \n\
-");
-      printf ("\
+"));
+      printf (_("\
 Print the value of EXPRESSION to standard output.  A blank line below\n\
 separates increasing precedence groups.  EXPRESSION may be:\n\
 \n\
@@ -138,14 +138,14 @@ separates increasing precedence groups.  EXPRESSION may be:\n\
   length STRING              length of STRING\n\
 \n\
   ( EXPRESSION )             value of EXPRESSION\n\
-");
-      printf ("\
+"));
+      printf (_("\
 \n\
 Beware that many operators need to be escaped or quoted for shells.\n\
 Comparisons are arithmetic if both ARGs are numbers, else lexicographical.\n\
 Pattern matches return the string matched between \\( and \\) or null; if\n\
 \\( and \\) are not used, they return the number of characters matched or 0.\n\
-");
+"));
     }
   exit (status);
 }
@@ -163,7 +163,7 @@ main (argc, argv)
 
   if (argc == 1)
     {
-      error (0, 0, "too few arguments");
+      error (0, 0, _("too few arguments"));
       usage (1);
     }
 
@@ -171,7 +171,7 @@ main (argc, argv)
 
   v = eval ();
   if (!nomoreargs ())
-    error (2, 0, "syntax error");
+    error (2, 0, _("syntax error"));
   printv (v);
 
   exit (null (v));
@@ -374,7 +374,7 @@ static                                              \
 int name (l, r) VALUE *l; VALUE *r;            \
 {                                              \
   if (!toarith (l) || !toarith (r))            \
-    error (2, 0, "non-numeric argument");      \
+    error (2, 0, _("non-numeric argument"));   \
   return l->u.i op r->u.i;                     \
 }
 
@@ -382,9 +382,9 @@ int name (l, r) VALUE *l; VALUE *r;         \
 int name (l, r) VALUE *l; VALUE *r;            \
 {                                              \
   if (!toarith (l) || !toarith (r))            \
-    error (2, 0, "non-numeric argument");      \
+    error (2, 0, _("non-numeric argument"));   \
   if (r->u.i == 0)                             \
-    error (2, 0, "division by zero");          \
+    error (2, 0, _("division by zero"));               \
   return l->u.i op r->u.i;                     \
 }
 
@@ -476,20 +476,20 @@ eval7 ()
   trace ("eval7");
 #endif
   if (nomoreargs ())
-    error (2, 0, "syntax error");
+    error (2, 0, _("syntax error"));
 
   if (nextarg ("("))
     {
       args++;
       v = eval ();
       if (!nextarg (")"))
-       error (2, 0, "syntax error");
+       error (2, 0, _("syntax error"));
       args++;
       return v;
     }
 
   if (nextarg (")"))
-    error (2, 0, "syntax error");
+    error (2, 0, _("syntax error"));
 
   return str_value (*args++);
 }
index c4a25b3..d46da0d 100644 (file)
@@ -45,20 +45,20 @@ usage (status)
      int status;
 {
   if (status != 0)
-    fprintf (stderr, "Try `%s --help' for more information.\n",
+    fprintf (stderr, _("Try `%s --help' for more information.\n"),
             program_name);
   else
     {
-      printf ("\
+      printf (_("\
 Usage: %s [NUMBER]\n\
   or:  %s OPTION\n\
-",
+"),
              program_name, program_name);
-      printf ("\
+      printf (_("\
 \n\
   --help      display this help and exit\n\
   --version   output version information and exit\n\
-");
+"));
     }
   exit (status);
 }
@@ -153,7 +153,7 @@ main (argc, argv)
 
   if (argc > 2)
     {
-      error (0, 0, "too many arguments");
+      error (0, 0, _("too many arguments"));
       usage (1);
     }
 
@@ -165,7 +165,7 @@ main (argc, argv)
     }
   else
     {
-      fprintf (stderr, "Usage: %s [number]\n", argv[0]);
+      fprintf (stderr, _("Usage: %s [number]\n"), argv[0]);
       exit (1);
     }
   exit (0);
index ef89bb3..bcf709b 100644 (file)
@@ -57,18 +57,18 @@ usage (status)
      int status;
 {
   if (status != 0)
-    fprintf (stderr, "Try `%s --help' for more information.\n",
+    fprintf (stderr, _("Try `%s --help' for more information.\n"),
             program_name);
   else
     {
-      printf ("\
+      printf (_("\
 Usage: %s [NAME]\n\
   or:  %s OPTION\n\
 Print the hostname of the current system.\n\
 \n\
   --help      display this help and exit\n\
   --version   output version information and exit\n\
-"
+")
              , program_name, program_name);
     }
   exit (status);
@@ -98,19 +98,20 @@ main (argc, argv)
     }
 #else
   if (argc == 2)
-    error (1, 0, "cannot set hostname; this system lacks the functionality");
+    error (1, 0,
+          _("cannot set hostname; this system lacks the functionality"));
 #endif
 
   if (argc == 1)
     {
       hostname = xgethostname ();
       if (hostname == NULL)
-       error (1, errno, "cannot determine hostname");
+       error (1, errno, _("cannot determine hostname"));
       printf ("%s\n", hostname);
     }
   else
     {
-      error (2, 0, "too many arguments");
+      error (2, 0, _("too many arguments"));
       usage (1);
     }
 
index 1d04944..b02ba78 100644 (file)
--- a/src/id.c
+++ b/src/id.c
@@ -148,10 +148,10 @@ main (argc, argv)
     usage (0);
 
   if (just_user + just_group + just_group_list > 1)
-    error (1, 0, "cannot print only user and only group");
+    error (1, 0, _("cannot print only user and only group"));
 
   if (just_user + just_group + just_group_list == 0 && (use_real || use_name))
-    error (1, 0, "cannot print only names or real IDs in default format");
+    error (1, 0, _("cannot print only names or real IDs in default format"));
 
   if (argc - optind > 1)
     usage (1);
@@ -160,7 +160,7 @@ main (argc, argv)
     {
       struct passwd *pwd = getpwnam (argv[optind]);
       if (pwd == NULL)
-       error (1, 0, "%s: No such user", argv[optind]);
+       error (1, 0, _("%s: No such user"), argv[optind]);
       ruid = euid = pwd->pw_uid;
       rgid = egid = pwd->pw_gid;
     }
@@ -253,7 +253,7 @@ print_group_list (username)
       ngroups = getugroups (NGROUPS_MAX, groups, username);
     if (ngroups < 0)
       {
-       error (0, errno, "cannot get supplemental group list");
+       error (0, errno, _("cannot get supplemental group list"));
        problems++;
        free (groups);
        return;
@@ -326,14 +326,14 @@ print_full_info (username)
       ngroups = getugroups (NGROUPS_MAX, groups, username);
     if (ngroups < 0)
       {
-       error (0, errno, "cannot get supplemental group list");
+       error (0, errno, _("cannot get supplemental group list"));
        problems++;
        free (groups);
        return;
       }
 
     if (ngroups > 0)
-      fputs (" groups=", stdout);
+      fputs (_(" groups="), stdout);
     for (i = 0; i < ngroups; i++)
       {
        if (i > 0)
@@ -355,12 +355,12 @@ usage (status)
      int status;
 {
   if (status != 0)
-    fprintf (stderr, "Try `%s --help' for more information.\n",
+    fprintf (stderr, _("Try `%s --help' for more information.\n"),
             program_name);
   else
     {
-      printf ("Usage: %s [OPTION]... [USERNAME]\n", program_name);
-      printf ("\
+      printf (_("Usage: %s [OPTION]... [USERNAME]\n"), program_name);
+      printf (_("\
 Print information for USERNAME, or the current user.\n\
 \n\
   -g, --group     print only the group ID\n\
@@ -372,7 +372,7 @@ Print information for USERNAME, or the current user.\n\
       --version   output version information and exit\n\
 \n\
 Without any OPTION, print some useful set of identified information.\n\
-");
+"));
     }
   exit (status);
 }
index 916a989..44b53a8 100644 (file)
@@ -44,17 +44,17 @@ usage (status)
      int status;
 {
   if (status != 0)
-    fprintf (stderr, "Try `%s --help' for more information.\n",
+    fprintf (stderr, _("Try `%s --help' for more information.\n"),
             program_name);
   else
     {
-      printf ("Usage: %s [OPTION]...\n", program_name);
-      printf ("\
+      printf (_("Usage: %s [OPTION]...\n"), program_name);
+      printf (_("\
 Print the name of the current user.\n\
 \n\
   --help      display this help and exit\n\
   --version   output version information and exit\n\
-");
+"));
     }
   exit (status);
 }
@@ -101,6 +101,6 @@ main (argc, argv)
       exit (0);
     }
   /* POSIX.2 prohibits using a fallback technique.  */
-  fprintf (stderr,"%s: no login name\n", argv[0]);
+  fprintf (stderr,_("%s: no login name\n"), argv[0]);
   exit (1);
 }
index 337c413..9b54abb 100644 (file)
@@ -77,7 +77,7 @@ main (argc, argv)
       if (s[0] == '-' && s[1] == '-' && ISDIGIT (s[2]))
        {
          if (!isinteger (&s[2]))
-           error (1, 0, "invalid option `%s'", s);
+           error (1, 0, _("invalid option `%s'"), s);
 
          minusflag = 1;
          adjustment = atoi (&s[2]);
@@ -98,7 +98,7 @@ main (argc, argv)
 
                case 'n':
                  if (!isinteger (optarg))
-                   error (1, 0, "invalid priority `%s'", optarg);
+                   error (1, 0, _("invalid priority `%s'"), optarg);
                  adjustment = atoi (optarg);
                  adjustment_given = 1;
                  break;
@@ -133,14 +133,14 @@ main (argc, argv)
     {
       if (adjustment_given)
        {
-         error (0, 0, "a command must be given with an adjustment");
+         error (0, 0, _("a command must be given with an adjustment"));
          usage (1);
        }
       /* No command given; print the priority. */
       errno = 0;
       current_priority = GET_PRIORITY ();
       if (current_priority == -1 && errno != 0)
-       error (1, errno, "cannot get priority");
+       error (1, errno, _("cannot get priority"));
       printf ("%d\n", current_priority);
       exit (0);
     }
@@ -149,12 +149,12 @@ main (argc, argv)
   errno = 0;
   current_priority = GET_PRIORITY ();
   if (current_priority == -1 && errno != 0)
-    error (1, errno, "cannot get priority");
+    error (1, errno, _("cannot get priority"));
   if (setpriority (PRIO_PROCESS, 0, current_priority + adjustment))
 #else
   if (nice (adjustment) == -1)
 #endif
-    error (1, errno, "cannot set priority");
+    error (1, errno, _("cannot set priority"));
 
   execvp (argv[optind], &argv[optind]);
   error (errno == ENOENT ? 127 : 126, errno, "%s", argv[optind]);
@@ -185,12 +185,12 @@ usage (status)
      int status;
 {
   if (status != 0)
-    fprintf (stderr, "Try `%s --help' for more information.\n",
+    fprintf (stderr, _("Try `%s --help' for more information.\n"),
             program_name);
   else
     {
-      printf ("Usage: %s [OPTION]... [COMMAND [ARG]...]\n", program_name);
-      printf ("\
+      printf (_("Usage: %s [OPTION]... [COMMAND [ARG]...]\n"), program_name);
+      printf (_("\
 Run COMMAND with an adjusted scheduling priority.\n\
 With no COMMAND, print the current scheduling priority.  ADJUST is 10\n\
 by default.  Range goes from -20 (highest priority) to 19 (lowest).\n\
@@ -198,7 +198,7 @@ by default.  Range goes from -20 (highest priority) to 19 (lowest).\n\
   -ADJUST                   increment priority by ADJUST first\n\
   -n, --adjustment=ADJUST   same as -ADJUST\n\
       --help                display this help and exit\n\
-      --version             output version information and exit\n");
+      --version             output version information and exit\n"));
     }
   exit (status);
 }
index fecd610..2b10b8c 100644 (file)
@@ -151,7 +151,7 @@ main (argc, argv)
 
   if (optind == argc)
     {
-      error (0, 0, "too few arguments");
+      error (0, 0, _("too few arguments"));
       usage (1);
     }
 
@@ -195,7 +195,7 @@ portable_chars_only (path)
   for (p = path; *p; ++p)
     if (portable_chars[(const unsigned char) *p] == 0)
       {
-       error (0, 0, "path `%s' contains nonportable character `%c'",
+       error (0, 0, _("path `%s' contains nonportable character `%c'"),
               path, *p);
        return 0;
       }
@@ -216,7 +216,7 @@ dir_ok (path)
 
   if (!S_ISDIR (stats.st_mode))
     {
-      error (0, 0, "`%s' is not a directory", path);
+      error (0, 0, _("`%s' is not a directory"), path);
       return 0;
     }
 
@@ -227,7 +227,7 @@ dir_ok (path)
   if (access (path, X_OK) != 0)
     {
       if (errno == EACCES)
-       error (0, 0, "directory `%s' is not searchable", path);
+       error (0, 0, _("directory `%s' is not searchable"), path);
       else
        error (0, errno, "%s", path);
       return 0;
@@ -321,7 +321,7 @@ validate_path (path, portability)
        name_max = _POSIX_NAME_MAX;
       if (length > name_max)
        {
-         error (0, 0, "name `%s' has length %d; exceeds limit of %d",
+         error (0, 0, _("name `%s' has length %d; exceeds limit of %d"),
                 start, length, name_max);
          free (parent);
          return 1;
@@ -347,7 +347,7 @@ validate_path (path, portability)
   free (parent);
   if (strlen (path) > path_max)
     {
-      error (0, 0, "path `%s' has length %d; exceeds limit of %d",
+      error (0, 0, _("path `%s' has length %d; exceeds limit of %d"),
             path, strlen (path), path_max);
       return 1;
     }
@@ -360,18 +360,18 @@ usage (status)
      int status;
 {
   if (status != 0)
-    fprintf (stderr, "Try `%s --help' for more information.\n",
+    fprintf (stderr, _("Try `%s --help' for more information.\n"),
             program_name);
   else
     {
-      printf ("Usage: %s [OPTION]... NAME...\n", program_name);
-      printf ("\
+      printf (_("Usage: %s [OPTION]... NAME...\n"), program_name);
+      printf (_("\
 Diagnose unportable constructs in NAME.\n\
 \n\
   -p, --portability   check for all POSIX systems, not only this one\n\
       --help          display this help and exit\n\
       --version       output version information and exit\n\
-");
+"));
     }
   exit (status);
 }
index 1786f9f..f631ab1 100644 (file)
@@ -59,16 +59,16 @@ usage (status)
      int status;
 {
   if (status != 0)
-    fprintf (stderr, "Try `%s --help' for more information.\n",
+    fprintf (stderr, _("Try `%s --help' for more information.\n"),
             program_name);
   else
     {
-      printf ("Usage: %s [OPTION]... [VARIABLE]...\n", program_name);
-      printf ("\
+      printf (_("Usage: %s [OPTION]... [VARIABLE]...\n"), program_name);
+      printf (_("\
 If no environment VARIABLE specified, print them all.\n\
 \n\
   --help      display this help and exit\n\
-  --version   output version information and exit\n");
+  --version   output version information and exit\n"));
     }
   exit (status);
 }
@@ -137,7 +137,7 @@ main (argc, argv)
     }
 
   if (ferror (stdout) || fclose (stdout) == EOF)
-    error (2, errno, "standard output");
+    error (2, errno, _("standard output"));
 
   exit (exit_status);
 }
index 63e40e5..d9cc0e2 100644 (file)
@@ -86,16 +86,16 @@ usage (status)
      int status;
 {
   if (status != 0)
-    fprintf (stderr, "Try `%s --help' for more information.\n",
+    fprintf (stderr, _("Try `%s --help' for more information.\n"),
             program_name);
   else
     {
-      printf ("\
+      printf (_("\
 Usage: %s FORMAT [ARGUMENT]...\n\
   or:  %s OPTION\n\
-",
+"),
              program_name, program_name);
-      printf ("\
+      printf (_("\
 Print ARGUMENT(s) according to FORMAT.\n\
 \n\
   --help      display this help and exit\n\
@@ -121,7 +121,7 @@ FORMAT controls the output as in C printf.  Interpreted sequences are:\n\
 \n\
 and all C format specifications ending with one of diouxXfeEgGcs, with\n\
 ARGUMENTs converted to proper type first.  Variable widths are handled.\n\
-");
+"));
     }
   exit (status);
 }
@@ -141,7 +141,7 @@ main (argc, argv)
 
   if (argc == 1)
     {
-      fprintf (stderr, "Usage: %s format [argument...]\n", program_name);
+      fprintf (stderr, _("Usage: %s format [argument...]\n"), program_name);
       exit (1);
     }
 
@@ -254,7 +254,7 @@ print_formatted (format, argc, argv)
              ++direc_length;
            }
          if (!strchr ("diouxXfeEgGcs", *f))
-           error (1, 0, "%%%c: invalid directive", *f);
+           error (1, 0, _("%%%c: invalid directive"), *f);
          ++direc_length;
          if (argc > 0)
            {
@@ -300,7 +300,7 @@ print_esc (escstart)
           ++esc_length, ++p)
        esc_value = esc_value * 16 + hextobin (*p);
       if (esc_length == 0)
-       error (1, 0, "missing hexadecimal number in escape");
+       error (1, 0, _("missing hexadecimal number in escape"));
       putchar (esc_value);
     }
   else if (*p == '0')
@@ -314,7 +314,7 @@ print_esc (escstart)
   else if (strchr ("\"\\abcfnrtv", *p))
     print_esc_char (*p++);
   else
-    error (1, 0, "\\%c: invalid escape", *p);
+    error (1, 0, _("\\%c: invalid escape"), *p);
   return p - escstart - 1;
 }
 
@@ -525,9 +525,9 @@ verify (s, end)
   else if (*end)
     {
       if (s == end)
-       error (0, 0, "%s: expected a numeric value", s);
+       error (0, 0, _("%s: expected a numeric value"), s);
       else
-       error (0, 0, "%s: value not completely converted", s);
+       error (0, 0, _("%s: value not completely converted"), s);
       exit_status = 1;
     }
 }
index 54c21ad..bbcde3b 100644 (file)
--- a/src/pwd.c
+++ b/src/pwd.c
@@ -36,17 +36,17 @@ usage (status)
      int status;
 {
   if (status != 0)
-    fprintf (stderr, "Try `%s --help' for more information.\n",
+    fprintf (stderr, _("Try `%s --help' for more information.\n"),
             program_name);
   else
     {
-      printf ("Usage: %s [OPTION]\n", program_name);
-      printf ("\
+      printf (_("Usage: %s [OPTION]\n"), program_name);
+      printf (_("\
 Print the full filename of the current working directory.\n\
 \n\
   --help      display this help and exit\n\
   --version   output version information and exit\n\
-");
+"));
     }
   exit (status);
 }
@@ -63,11 +63,11 @@ main (argc, argv)
   parse_long_options (argc, argv, "pwd", version_string, usage);
 
   if (argc != 1)
-    error (0, 0, "ignoring non-option arguments");
+    error (0, 0, _("ignoring non-option arguments"));
 
   wd = xgetcwd ();
   if (wd == NULL)
-    error (1, errno, "cannot get current directory");
+    error (1, errno, _("cannot get current directory"));
   printf ("%s\n", wd);
 
   exit (0);
index 667cf77..ec72eea 100644 (file)
--- a/src/seq.c
+++ b/src/seq.c
@@ -72,14 +72,14 @@ usage (status)
      int status;
 {
   if (status != 0)
-    (void) fprintf (stderr, "Try `%s --help' for more information.\n",
+    (void) fprintf (stderr, _("Try `%s --help' for more information.\n"),
                    program_name);
   else
     {
-      (void) printf ("\
+      (void) printf (_("\
 Usage: %s [OPTION]... [from [step]] to\n\
-", program_name);
-      (void) printf ("\
+"), program_name);
+      (void) printf (_("\
 \n\
   -f, --format FORMAT      use printf(3) style FORMAT (default: %%g)\n\
       --help               display this help and exit\n\
@@ -90,7 +90,7 @@ Usage: %s [OPTION]... [from [step]] to\n\
   FROM, STEP, TO are interpreted as floating point.  STEP should be > 0 if\n\
   FROM is smaller than TO and vice versa.  When given, the FORMAT argument\n\
   must contain exactly one of the float output formats %%e, %%f, or %%g.\n\
-");
+"));
     }
   exit (status);
 }
@@ -160,7 +160,7 @@ main (argc, argv)
 
   if (optind >= argc)
     {
-      error (0, 0, "too few arguments");
+      error (0, 0, _("too few arguments"));
       usage (1);
       /* NOTREACHED */
     }
@@ -187,8 +187,8 @@ main (argc, argv)
 
   if (format_str != NULL && equal_width)
     {
-      error (0, 0,
-       "format string may not be specified when printing equal width strings");
+      error (0, 0, _("\
+format string may not be specified when printing equal width strings"));
       usage (1);
     }
 
@@ -201,7 +201,7 @@ main (argc, argv)
     {
       if (!check_format (format_str))
        {
-         error (0, 0, "invalid format string: `%s'", format_str);
+         error (0, 0, _("invalid format string: `%s'"), format_str);
          usage (1);
        }
     }
@@ -233,7 +233,7 @@ scan_double_arg (arg)
   ret_val = strtod (arg, &end_ptr);
   if (end_ptr == arg || *end_ptr != '\0')
     {
-      error (0, 0, "invalid float argument: %s", arg);
+      error (0, 0, _("invalid float argument: %s"), arg);
       usage (1);
       /* NOTREACHED */
     }
@@ -390,7 +390,7 @@ print_numbers (format_str)
     {
       if (step >= 0)
        {
-         error (0, 0, "invalid increment: %g", step);
+         error (0, 0, _("invalid increment: %g"), step);
          usage (1);
          /* NOTREACHED */
        }
@@ -411,7 +411,7 @@ print_numbers (format_str)
     {
       if (step <= 0)
        {
-         error (0, 0, "invalid increment: %g", step);
+         error (0, 0, _("invalid increment: %g"), step);
          usage (1);
          /* NOTREACHED */
        }
index b590bef..15b8fb0 100644 (file)
@@ -47,17 +47,17 @@ usage (status)
      int status;
 {
   if (status != 0)
-    fprintf (stderr, "Try `%s --help' for more information.\n",
+    fprintf (stderr, _("Try `%s --help' for more information.\n"),
             program_name);
   else
     {
-      printf ("Usage: %s [OPTION]... NUMBER[SUFFIX]\n", program_name);
-      printf ("\
+      printf (_("Usage: %s [OPTION]... NUMBER[SUFFIX]\n"), program_name);
+      printf (_("\
 Pause for NUMBER seconds.\n\
 SUFFIX may be s to keep seconds, m for minutes, h for hours or d for days.\n\
 \n\
   --help      display this help and exit\n\
-  --version   output version information and exit\n");
+  --version   output version information and exit\n"));
     }
   exit (status);
 }
@@ -96,7 +96,7 @@ main (argc, argv)
 
   if (argc == 1)
     {
-      error (0, 0, "too few arguments");
+      error (0, 0, _("too few arguments"));
       usage (1);
     }
 
@@ -138,6 +138,6 @@ argdecode (s)
     }
 
   if (*p)
-    error (1, 0, "invalid time interval `%s'", s);
+    error (1, 0, _("invalid time interval `%s'"), s);
   return value;
 }
index abfa34b..05853ed 100644 (file)
@@ -456,16 +456,16 @@ usage (status)
      int status;
 {
   if (status != 0)
-    fprintf (stderr, "Try `%s --help' for more information.\n",
+    fprintf (stderr, _("Try `%s --help' for more information.\n"),
             program_name);
   else
     {
-      printf ("\
+      printf (_("\
 Usage: %s [SETTING]...\n\
   or:  %s OPTION\n\
-",
+"),
              program_name, program_name);
-      printf ("\
+      printf (_("\
 Print or change terminal characteristics.\n\
 \n\
   -a, --all       print all current settings in human-readable form\n\
@@ -475,8 +475,8 @@ Print or change terminal characteristics.\n\
 \n\
 Optional - before SETTING indicates negation.  An * marks non-POSIX\n\
 settings.  The underlying system defines which settings are available.\n\
-");
-      printf ("\
+"));
+      printf (_("\
 \n\
 Special characters:\n\
 * dsusp CHAR    CHAR will send a terminal stop signal once input flushed\n\
@@ -494,8 +494,8 @@ Special characters:\n\
   susp CHAR     CHAR will send a terminal stop signal\n\
 * swtch CHAR    CHAR will switch to a different shell layer\n\
 * werase CHAR   CHAR will erase the last word typed\n\
-");
-      printf ("\
+"));
+      printf (_("\
 \n\
 Special settings:\n\
   N             set the input and output speeds to N bauds\n\
@@ -509,8 +509,8 @@ Special settings:\n\
 * size          print the number of rows and columns according to the kernel\n\
   speed         print the terminal speed\n\
   time N        with -icanon, set read timeout of N tenths of a second\n\
-");
-      printf ("\
+"));
+      printf (_("\
 \n\
 Control settings:\n\
   [-]clocal     disable modem control signals\n\
@@ -522,8 +522,8 @@ Control settings:\n\
   [-]hupcl      same as [-]hup\n\
   [-]parenb     generate parity bit in output and expect parity bit in input\n\
   [-]parodd     set odd parity (even with `-')\n\
-");
-      printf ("\
+"));
+      printf (_("\
 \n\
 Input settings:\n\
   [-]brkint     breaks cause an interrupt signal\n\
@@ -541,8 +541,8 @@ Input settings:\n\
   [-]ixon       enable XON/XOFF flow control\n\
   [-]parmrk     mark parity errors (with a 255-0-character sequence)\n\
   [-]tandem     same as [-]ixoff\n\
-");
-      printf ("\
+"));
+      printf (_("\
 \n\
 Output settings:\n\
 * bsN           backspace delay style, N in [0..1]\n\
@@ -561,8 +561,8 @@ Output settings:\n\
 * tabs          same as tab0\n\
 * -tabs         same as tab3\n\
 * vtN           vertical tab delay style, N in [0..1]\n\
-");
-      printf ("\
+"));
+      printf (_("\
 \n\
 Local settings:\n\
   [-]crterase   echo erase characters as backspace-space-backspace\n\
@@ -583,8 +583,8 @@ Local settings:\n\
 * [-]prterase   same as [-]echoprt\n\
 * [-]tostop     stop background jobs that try to write to the terminal\n\
 * [-]xcase      with icanon, escape with `\\' for uppercase characters\n\
-");
-      printf ("\
+"));
+      printf (_("\
 \n\
 Combination settings:\n\
 * [-]LCASE      same as [-]lcase\n\
@@ -620,14 +620,14 @@ Combination settings:\n\
                 isig icanon iexten echo echoe echok -echonl -noflsh\n\
                 -xcase -tostop -echoprt echoctl echoke, all special\n\
                 characters to their default values.\n\
-");
-      printf ("\
+"));
+      printf (_("\
 \n\
 Handle the tty line connected to standard input.  Without arguments,\n\
 prints baud rate, line discipline, and deviations from stty sane.  In\n\
 settings, CHAR is taken literally, or coded as in ^c, 0x37, 0177 or\n\
 127; special values ^- or undef used to disable special characters.\n\
-");
+"));
     }
   exit (status);
 }
@@ -712,18 +712,18 @@ main (argc, argv)
   /* Specifying both -a and -g gets an error.  */
   if (verbose_output && recoverable_output)
     error (2, 0,
-          "the options for verbose and stty-readable output styles are\n\
-\tmutually exclusive");
+          _("the options for verbose and stty-readable output styles are\n\
+\tmutually exclusive"));
 
   /* Specifying any other arguments with -a or -g gets an error.  */
   if (argc - optind > 0 && (verbose_output || recoverable_output))
-    error (2, 0, "when specifying an output style, modes may not be set");
+    error (2, 0, _("when specifying an output style, modes may not be set"));
 
   /* Initialize to all zeroes so there is no risk memcmp will report a
      spurious difference in an uninitialized portion of the structure.  */
   memset (&mode, 0, sizeof (mode));
   if (tcgetattr (0, &mode))
-    error (1, errno, "standard input");
+    error (1, errno, _("standard input"));
 
   if (verbose_output || recoverable_output || argc == 1)
     {
@@ -758,7 +758,7 @@ main (argc, argv)
        }
       if (match_found == 0 && reversed)
        {
-         error (0, 0, "invalid argument `%s'", --argv[k]);
+         error (0, 0, _("invalid argument `%s'"), --argv[k]);
          usage (1);
        }
       if (match_found == 0)
@@ -769,7 +769,7 @@ main (argc, argv)
                {
                  if (k == argc - 1)
                    {
-                     error (0, 0, "missing argument to `%s'", argv[k]);
+                     error (0, 0, _("missing argument to `%s'"), argv[k]);
                      usage (1);
                    }
                  match_found = 1;
@@ -786,7 +786,7 @@ main (argc, argv)
            {
              if (k == argc - 1)
                {
-                 error (0, 0, "missing argument to `%s'", argv[k]);
+                 error (0, 0, _("missing argument to `%s'"), argv[k]);
                  usage (1);
                }
              ++k;
@@ -798,7 +798,7 @@ main (argc, argv)
            {
              if (k == argc - 1)
                {
-                 error (0, 0, "missing argument to `%s'", argv[k]);
+                 error (0, 0, _("missing argument to `%s'"), argv[k]);
                  usage (1);
                }
              ++k;
@@ -811,7 +811,7 @@ main (argc, argv)
            {
              if (k == argc - 1)
                {
-                 error (0, 0, "missing argument to `%s'", argv[k]);
+                 error (0, 0, _("missing argument to `%s'"), argv[k]);
                  usage (1);
                }
              ++k;
@@ -822,7 +822,7 @@ main (argc, argv)
            {
              if (k == argc - 1)
                {
-                 error (0, 0, "missing argument to `%s'", argv[k]);
+                 error (0, 0, _("missing argument to `%s'"), argv[k]);
                  usage (1);
                }
              ++k;
@@ -840,7 +840,7 @@ main (argc, argv)
            {
              if (k == argc - 1)
                {
-                 error (0, 0, "missing argument to `%s'", argv[k]);
+                 error (0, 0, _("missing argument to `%s'"), argv[k]);
                  usage (1);
                }
              ++k;
@@ -863,7 +863,7 @@ main (argc, argv)
            {
              if (recover_mode (argv[k], &mode) == 0)
                {
-                 error (0, 0, "invalid argument `%s'", argv[k]);
+                 error (0, 0, _("invalid argument `%s'"), argv[k]);
                  usage (1);
                }
              require_set_attr = 1;
@@ -877,7 +877,7 @@ main (argc, argv)
       struct termios new_mode;
 
       if (tcsetattr (0, TCSADRAIN, &mode))
-       error (1, errno, "standard input");
+       error (1, errno, _("standard input"));
 
       /* POSIX (according to Zlotnick's book) tcsetattr returns zero if
         it performs *any* of the requested operations.  This means it
@@ -890,7 +890,7 @@ main (argc, argv)
         spurious difference in an uninitialized portion of the structure.  */
       memset (&new_mode, 0, sizeof (new_mode));
       if (tcgetattr (0, &new_mode))
-       error (1, errno, "standard input");
+       error (1, errno, _("standard input"));
 
       /* Normally, one shouldn't use memcmp to compare structures that
         may have `holes' containing uninitialized data, but we have been
@@ -917,8 +917,8 @@ main (argc, argv)
            {
            int i;
            error (1, 0,
-             "standard input: unable to perform all requested operations");
-           printf ("new_mode: mode\n");
+             _("standard input: unable to perform all requested operations"));
+           printf (_("new_mode: mode\n"));
            for (i=0; i<sizeof(new_mode); i++)
              printf ("0x%02x: 0x%02x\n",
                      *(((unsigned char *) &new_mode) + i),
@@ -1209,7 +1209,7 @@ set_window_size (rows, cols)
   if (get_win_size (&win))
     {
       if (errno != EINVAL)
-       error (1, errno, "standard input");
+       error (1, errno, _("standard input"));
       memset (&win, 0, sizeof (win));
     }
 
@@ -1251,16 +1251,16 @@ set_window_size (rows, cols)
       win.ws_col = 1;
 
       if (ioctl (0, TIOCSWINSZ, (char *) &win))
-       error (1, errno, "standard input");
+       error (1, errno, _("standard input"));
 
       if (ioctl (0, TIOCSSIZE, (char *) &ttysz))
-       error (1, errno, "standard input");
+       error (1, errno, _("standard input"));
       return;
     }
 #endif
 
   if (ioctl (0, TIOCSWINSZ, (char *) &win))
-    error (1, errno, "standard input");
+    error (1, errno, _("standard input"));
 }
 
 static void
@@ -1272,7 +1272,7 @@ display_window_size (fancy)
   if (get_win_size (&win))
     {
       if (errno != EINVAL)
-       error (1, errno, "standard input");
+       error (1, errno, _("standard input"));
     }
   else
     {
@@ -1295,7 +1295,7 @@ screen_columns ()
       /* With Solaris 2.[123], this ioctl fails and errno is set to
         EINVAL for telnet (but not rlogin) sessions.  */
       if (errno != EINVAL)
-       error (1, errno, "standard input");
+       error (1, errno, _("standard input"));
     }
   else if (win.ws_col > 0)
     return win.ws_col;
@@ -1636,7 +1636,7 @@ visible (ch)
   char *bpout = buf;
 
   if (ch == _POSIX_VDISABLE)
-    return "<undef>";
+    return _("<undef>");
 
   if (ch >= 32)
     {
@@ -1720,7 +1720,7 @@ integer_arg (s)
 
   if (*p)
     {
-      error (0, 0, "invalid integer argument `%s'", s);
+      error (0, 0, _("invalid integer argument `%s'"), s);
       usage (1);
     }
   return value;
index a41706a..4b717f0 100644 (file)
--- a/src/su.c
+++ b/src/su.c
@@ -261,7 +261,7 @@ main (argc, argv)
 
   pw = getpwnam (new_user);
   if (pw == 0)
-    error (1, 0, "user %s does not exist", new_user);
+    error (1, 0, _("user %s does not exist"), new_user);
   endpwent ();
 
   /* Make a copy of the password information and point pw at the local
@@ -278,7 +278,7 @@ main (argc, argv)
 #ifdef SYSLOG_FAILURE
       log_su (pw, 0);
 #endif
-      error (1, 0, "incorrect password");
+      error (1, 0, _("incorrect password"));
     }
 #ifdef SYSLOG_SUCCESS
   else
@@ -297,7 +297,7 @@ main (argc, argv)
         probably a uucp account or has restricted access.  Don't
         compromise the account by allowing access with a standard
         shell.  */
-      error (0, 0, "using restricted shell %s", pw->pw_shell);
+      error (0, 0, _("using restricted shell %s"), pw->pw_shell);
       shell = 0;
     }
   if (shell == 0)
@@ -308,7 +308,7 @@ main (argc, argv)
 
   change_identity (pw);
   if (simulate_login && chdir (pw->pw_dir))
-    error (0, errno, "warning: cannot change directory to %s", pw->pw_dir);
+    error (0, errno, _("warning: cannot change directory to %s"), pw->pw_dir);
 
   run_shell (shell, command, additional_args);
 }
@@ -337,10 +337,10 @@ correct_password (pw)
   if (getuid () == 0 || correct == 0 || correct[0] == '\0')
     return 1;
 
-  unencrypted = getpass ("Password:");
+  unencrypted = getpass (_("Password:"));
   if (unencrypted == NULL)
     {
-      error (0, 0, "getpass: cannot open /dev/tty");
+      error (0, 0, _("getpass: cannot open /dev/tty"));
       return 0;
     }
   encrypted = crypt (unencrypted, correct);
@@ -400,13 +400,13 @@ change_identity (pw)
 #ifdef HAVE_INITGROUPS
   errno = 0;
   if (initgroups (pw->pw_name, pw->pw_gid) == -1)
-    error (1, errno, "cannot set groups");
+    error (1, errno, _("cannot set groups"));
   endgrent ();
 #endif
   if (setgid (pw->pw_gid))
-    error (1, errno, "cannot set group id");
+    error (1, errno, _("cannot set group id"));
   if (setuid (pw->pw_uid))
-    error (1, errno, "cannot set user id");
+    error (1, errno, _("cannot set user id"));
 }
 
 /* Run SHELL, or DEFAULT_SHELL if SHELL is empty.
@@ -453,7 +453,7 @@ run_shell (shell, command, additional_args)
       args[argno++] = *additional_args;
   args[argno] = NULL;
   execv (shell, (char **) args);
-  error (1, errno, "cannot run %s", shell);
+  error (1, errno, _("cannot run %s"), shell);
 }
 
 #if defined (SYSLOG_SUCCESS) || defined (SYSLOG_FAILURE)
@@ -543,7 +543,7 @@ xputenv (val)
      char *val;
 {
   if (putenv (val))
-    error (1, 0, "virtual memory exhausted");
+    error (1, 0, _("virtual memory exhausted"));
 }
 
 /* Return a newly-allocated string whose contents concatenate
@@ -569,12 +569,12 @@ usage (status)
      int status;
 {
   if (status != 0)
-    fprintf (stderr, "Try `%s --help' for more information.\n",
+    fprintf (stderr, _("Try `%s --help' for more information.\n"),
             program_name);
   else
     {
-      printf ("Usage: %s [OPTION]... [-] [USER [ARG]...]\n", program_name);
-      printf ("\
+      printf (_("Usage: %s [OPTION]... [-] [USER [ARG]...]\n"), program_name);
+      printf (_("\
 Change the effective user id and group id to that of USER.\n\
 \n\
   -, -l, --login               make the shell a login shell\n\
@@ -587,7 +587,7 @@ Change the effective user id and group id to that of USER.\n\
       --version                output version information and exit\n\
 \n\
 A mere - implies -l.   If USER not given, assume root.\n\
-");
+"));
     }
   exit (status);
 }
index 5554d15..b81d375 100644 (file)
--- a/src/tee.c
+++ b/src/tee.c
@@ -61,19 +61,19 @@ usage (status)
      int status;
 {
   if (status != 0)
-    fprintf (stderr, "Try `%s --help' for more information.\n",
+    fprintf (stderr, _("Try `%s --help' for more information.\n"),
             program_name);
   else
     {
-      printf ("Usage: %s [OPTION]... [FILE]...\n", program_name);
-      printf ("\
+      printf (_("Usage: %s [OPTION]... [FILE]...\n"), program_name);
+      printf (_("\
 Copy standard input to each FILE, and also to standard output.\n\
 \n\
   -a, --append              append to the given FILEs, do not overwrite\n\
   -i, --ignore-interrupts   ignore interrupt signals\n\
       --help                display this help and exit\n\
       --version             output version information and exit\n\
-");
+"));
     }
   exit (status);
 }
@@ -136,9 +136,9 @@ main (argc, argv)
 
   errs = tee (argc - optind, (const char **) &argv[optind]);
   if (close (0) != 0)
-    error (1, errno, "standard input");
+    error (1, errno, _("standard input"));
   if (close (1) != 0)
-    error (1, errno, "standard output");
+    error (1, errno, _("standard output"));
   exit (errs);
 }
 
@@ -171,7 +171,7 @@ tee (nfiles, files)
   /* In the array of NFILES + 1 descriptors, make
      the first one correspond to standard output.   */
   descriptors[0] = 1;
-  files[0] = "standard output";
+  files[0] = _("standard output");
 
   for (i = 1; i <= nfiles; i++)
     {
@@ -212,7 +212,7 @@ tee (nfiles, files)
 
   if (bytes_read == -1)
     {
-      error (0, errno, "read error");
+      error (0, errno, _("read error"));
       ret = 1;
     }
 
index 2ba8585..b745c56 100644 (file)
@@ -234,7 +234,7 @@ advance (f)
 static void
 beyond ()
 {
-  test_syntax_error ("argument expected\n", NULL);
+  test_syntax_error (_("argument expected\n"), NULL);
 }
 
 /* Syntax error for when an integer argument was expected, but
@@ -243,7 +243,7 @@ static void
 integer_expected_error (pch)
      char *pch;
 {
-  test_syntax_error ("integer expression expected %s\n", pch);
+  test_syntax_error (_("integer expression expected %s\n"), pch);
 }
 
 /* Return non-zero if the characters pointed to by STRING constitute a
@@ -369,10 +369,10 @@ term ()
       advance (1);
       value = expr ();
       if (!argv[pos])
-       test_syntax_error ("')' expected\n", NULL);
+       test_syntax_error (_("')' expected\n"), NULL);
       else
         if (argv[pos][0] != ')' || argv[pos][1])
-         test_syntax_error ("')' expected, found %s\n", argv[pos]);
+         test_syntax_error (_("')' expected, found %s\n"), argv[pos]);
       advance (0);
       return (TRUE == (value));
     }
@@ -388,7 +388,7 @@ term ()
       if (unop (argv[pos][1]))
        value = unary_operator ();
       else
-       test_syntax_error ("%s: unary operator expected\n", argv[pos]);
+       test_syntax_error (_("%s: unary operator expected\n"), argv[pos]);
     }
   else
     {
@@ -415,7 +415,7 @@ binary_operator ()
 
       /* Make sure that OP is still a valid binary operator. */
       if ((op >= argc - 1) || (binop (argv[op]) == 0))
-       test_syntax_error ("%s: binary operator expected\n", argv[op]);
+       test_syntax_error (_("%s: binary operator expected\n"), argv[op]);
 
       advance (0);
     }
@@ -450,7 +450,7 @@ binary_operator ()
              else
                {
                  if (!isint (argv[op - 1], &l))
-                   integer_expected_error ("before -lt");
+                   integer_expected_error (_("before -lt"));
                }
 
              if (r_is_l)
@@ -458,7 +458,7 @@ binary_operator ()
              else
                {
                  if (!isint (argv[op + 1], &r))
-                   integer_expected_error ("after -lt");
+                   integer_expected_error (_("after -lt"));
                }
              pos += 3;
              return (TRUE == (l < r));
@@ -472,14 +472,14 @@ binary_operator ()
              else
                {
                  if (!isint (argv[op - 1], &l))
-                   integer_expected_error ("before -le");
+                   integer_expected_error (_("before -le"));
                }
              if (r_is_l)
                r = strlen (argv[op + 2]);
              else
                {
                  if (!isint (argv[op + 1], &r))
-                   integer_expected_error ("after -le");
+                   integer_expected_error (_("after -le"));
                }
              pos += 3;
              return (TRUE == (l <= r));
@@ -495,14 +495,14 @@ binary_operator ()
              else
                {
                  if (!isint (argv[op - 1], &l))
-                   integer_expected_error ("before -gt");
+                   integer_expected_error (_("before -gt"));
                }
              if (r_is_l)
                r = strlen (argv[op + 2]);
              else
                {
                  if (!isint (argv[op + 1], &r))
-                   integer_expected_error ("after -gt");
+                   integer_expected_error (_("after -gt"));
                }
              pos += 3;
              return (TRUE == (l > r));
@@ -516,14 +516,14 @@ binary_operator ()
              else
                {
                  if (!isint (argv[op - 1], &l))
-                   integer_expected_error ("before -ge");
+                   integer_expected_error (_("before -ge"));
                }
              if (r_is_l)
                r = strlen (argv[op + 2]);
              else
                {
                  if (!isint (argv[op + 1], &r))
-                   integer_expected_error ("after -ge");
+                   integer_expected_error (_("after -ge"));
                }
              pos += 3;
              return (TRUE == (l >= r));
@@ -536,7 +536,7 @@ binary_operator ()
              /* nt - newer than */
              pos += 3;
              if (l_is_l || r_is_l)
-               test_syntax_error ("-nt does not accept -l\n", NULL);
+               test_syntax_error (_("-nt does not accept -l\n"), NULL);
              if (age_of (argv[op - 1], &l) && age_of (argv[op + 1], &r))
                return (TRUE == (l > r));
              else
@@ -551,14 +551,14 @@ binary_operator ()
              else
                {
                  if (!isint (argv[op - 1], &l))
-                   integer_expected_error ("before -ne");
+                   integer_expected_error (_("before -ne"));
                }
              if (r_is_l)
                r = strlen (argv[op + 2]);
              else
                {
                  if (!isint (argv[op + 1], &r))
-                   integer_expected_error ("after -ne");
+                   integer_expected_error (_("after -ne"));
                }
              pos += 3;
              return (TRUE == (l != r));
@@ -574,14 +574,14 @@ binary_operator ()
              else
                {
                  if (!isint (argv[op - 1], &l))
-                   integer_expected_error ("before -eq");
+                   integer_expected_error (_("before -eq"));
                }
              if (r_is_l)
                r = strlen (argv[op + 2]);
              else
                {
                  if (!isint (argv[op + 1], &r))
-                   integer_expected_error ("after -eq");
+                   integer_expected_error (_("after -eq"));
                }
              pos += 3;
              return (TRUE == (l == r));
@@ -592,7 +592,7 @@ binary_operator ()
              /* ef - hard link? */
              pos += 3;
              if (l_is_l || r_is_l)
-               test_syntax_error ("-ef does not accept -l\n", NULL);
+               test_syntax_error (_("-ef does not accept -l\n"), NULL);
              if (stat (argv[op - 1], &stat_buf) < 0)
                return (FALSE);
              if (stat (argv[op + 1], &stat_spare) < 0)
@@ -609,14 +609,14 @@ binary_operator ()
              /* ot - older than */
              pos += 3;
              if (l_is_l || r_is_l)
-               test_syntax_error ("-nt does not accept -l\n", NULL);
+               test_syntax_error (_("-nt does not accept -l\n"), NULL);
              if (age_of (argv[op - 1], &l) && age_of (argv[op + 1], &r))
                return (TRUE == (l < r));
              return (FALSE);
            }
          break;
        }
-      test_syntax_error ("unknown binary operator", argv[op]);
+      test_syntax_error (_("unknown binary operator"), argv[op]);
     }
 
   if (argv[op][0] == '=' && !argv[op][1])
@@ -900,7 +900,7 @@ two_arguments ()
       if (unop (argv[pos][1]))
        value = unary_operator ();
       else
-       test_syntax_error ("%s: unary operator expected\n", argv[pos]);
+       test_syntax_error (_("%s: unary operator expected\n"), argv[pos]);
     }
   else
     beyond ();
@@ -926,7 +926,7 @@ three_arguments ()
           (argv[pos][0] == '('))
     value = expr ();
   else
-    test_syntax_error ("%s: binary operator expected\n", argv[pos+1]);
+    test_syntax_error (_("%s: binary operator expected\n"), argv[pos+1]);
   return (value);
 }
 
@@ -981,25 +981,25 @@ usage (status)
      int status;
 {
   if (status != 0)
-    fprintf (stderr, "Try `%s --help' for more information.\n",
+    fprintf (stderr, _("Try `%s --help' for more information.\n"),
             program_name);
   else
     {
-      printf ("\
+      printf (_("\
 Usage: %s EXPRESSION\n\
   or:  [ EXPRESSION ]\n\
   or:  %s OPTION\n\
-",
+"),
              program_name, program_name);
-      printf ("\
+      printf (_("\
 Exit with the status determined by EXPRESSION.\n\
 \n\
   --help      display this help and exit\n\
   --version   output version information and exit\n\
 \n\
 EXPRESSION is true or false and sets exit status.  It is one of:\n\
-");
-      printf ("\
+"));
+      printf (_("\
 \n\
   ( EXPRESSION )               EXPRESSION is true\n\
   ! EXPRESSION                 EXPRESSION is false\n\
@@ -1017,8 +1017,8 @@ EXPRESSION is true or false and sets exit status.  It is one of:\n\
   INTEGER1 -le INTEGER2   INTEGER1 is less than or equal to INTEGER2\n\
   INTEGER1 -lt INTEGER2   INTEGER1 is less than INTEGER2\n\
   INTEGER1 -ne INTEGER2   INTEGER1 is not equal to INTEGER2\n\
-");
-      printf ("\
+"));
+      printf (_("\
 \n\
   FILE1 -ef FILE2   FILE1 and FILE2 have the same device and inode numbers\n\
   FILE1 -nt FILE2   FILE1 is newer (modification date) than FILE2\n\
@@ -1042,12 +1042,12 @@ EXPRESSION is true or false and sets exit status.  It is one of:\n\
   -u FILE     FILE exists and its set-user-ID bit is set\n\
   -w FILE     FILE exists and is writable\n\
   -x FILE     FILE exists and is executable\n\
-");
-      printf ("\
+"));
+      printf (_("\
 \n\
 Beware that parentheses need to be escaped by backslashes for shells.\n\
 INTEGER may also be -l STRING, which evaluates to the length of STRING.\n\
-");
+"));
     }
   exit (status);
 }
@@ -1093,7 +1093,7 @@ test_command (margc, margv)
        test_exit (SHELL_BOOLEAN (FALSE));
 
       if (margv[margc] && strcmp (margv[margc], "]") != 0)
-       test_syntax_error ("missing `]'\n", NULL);
+       test_syntax_error (_("missing `]'\n"), NULL);
     }
 
   argc = margc;
@@ -1106,7 +1106,7 @@ test_command (margc, margv)
   value = posixtest ();
 
   if (pos != argc)
-    test_syntax_error ("too many arguments\n", NULL);
+    test_syntax_error (_("too many arguments\n"), NULL);
 
   test_exit (SHELL_BOOLEAN (value));
 }
index 68332a7..6a9baf1 100644 (file)
--- a/src/tty.c
+++ b/src/tty.c
@@ -99,10 +99,10 @@ main (argc, argv)
       if (tty)
        puts (tty);
       else
-       puts ("not a tty");
+       puts (_("not a tty"));
 
       if (ferror (stdout) || fclose (stdout) == EOF)
-       error (3, errno, "standard output");
+       error (3, errno, _("standard output"));
     }
 
   exit (isatty (0) ? 0 : 1);
@@ -113,18 +113,18 @@ usage (status)
      int status;
 {
   if (status != 0)
-    fprintf (stderr, "Try `%s --help' for more information.\n",
+    fprintf (stderr, _("Try `%s --help' for more information.\n"),
             program_name);
   else
     {
-      printf ("Usage: %s [OPTION]...\n", program_name);
-      printf ("\
+      printf (_("Usage: %s [OPTION]...\n"), program_name);
+      printf (_("\
 Print the file name of the terminal connected to standard input.\n\
 \n\
   -s, --silent, --quiet   print nothing, only return an exit status\n\
       --help              display this help and exit\n\
       --version           output version information and exit\n\
-");
+"));
     }
   exit (status);
 }
index e1e9ed0..6fd34d8 100644 (file)
@@ -146,7 +146,7 @@ main (argc, argv)
     toprint = PRINT_SYSNAME;
 
   if (uname (&name) == -1)
-    error (1, errno, "cannot get system name");
+    error (1, errno, _("cannot get system name"));
 
   print_element (PRINT_SYSNAME, name.sysname);
   print_element (PRINT_NODENAME, name.nodename);
@@ -178,12 +178,12 @@ usage (status)
      int status;
 {
   if (status != 0)
-    fprintf (stderr, "Try `%s --help' for more information.\n",
+    fprintf (stderr, _("Try `%s --help' for more information.\n"),
             program_name);
   else
     {
-      printf ("Usage: %s [OPTION]...\n", program_name);
-      printf ("\
+      printf (_("Usage: %s [OPTION]...\n"), program_name);
+      printf (_("\
 Print certain system information.  With no OPTION, same as -s.\n\
 \n\
   -a, --all        print all information\n\
@@ -193,7 +193,7 @@ Print certain system information.  With no OPTION, same as -s.\n\
   -s, --sysname    print the operating system name\n\
   -v               print the operating system version\n\
       --help       display this help and exit\n\
-      --version    output version information and exit\n");
+      --version    output version information and exit\n"));
     }
   exit (status);
 }
index d10d014..d311342 100644 (file)
--- a/src/who.c
+++ b/src/who.c
@@ -183,7 +183,7 @@ idle_string (when)
               (int) ((seconds_idle % (60 * 60)) / 60));
       return (const char *) idle;
     }
-  return " old ";
+  return _(" old ");
 }
 
 /* Display a line of information about entry THIS. */
@@ -282,7 +282,7 @@ list_entries_who (n)
        }
       this++;
     }
-  printf ("\n# users=%u\n", entries);
+  printf (_("\n# users=%u\n"), entries);
 }
 
 #endif /* WHO */
@@ -352,12 +352,12 @@ print_heading ()
 {
   printf ("%-8s ", "USER");
   if (include_mesg)
-    printf ("MESG ");
-  printf ("%-8s ", "LINE");
-  printf ("LOGIN-TIME   ");
+    printf (_("MESG "));
+  printf ("%-8s ", _("LINE"));
+  printf (_("LOGIN-TIME   "));
   if (include_idle)
-    printf ("IDLE  ");
-  printf ("FROM\n");
+    printf (_("IDLE  "));
+  printf (_("FROM\n"));
 }
 
 /* Display `utmp_contents', which should have N entries. */
@@ -506,12 +506,12 @@ usage (status)
      int status;
 {
   if (status != 0)
-    fprintf (stderr, "Try `%s --help' for more information.\n",
+    fprintf (stderr, _("Try `%s --help' for more information.\n"),
             program_name);
   else
     {
-      printf ("Usage: %s [OPTION]... [ FILE | ARG1 ARG2 ]\n", program_name);
-      printf ("\
+      printf (_("Usage: %s [OPTION]... [ FILE | ARG1 ARG2 ]\n"), program_name);
+      printf (_("\
 \n\
   -H, --heading     print line of column headings\n\
   -T, -w, --mesg    add user's message status as +, - or ?\n\
@@ -526,7 +526,7 @@ usage (status)
 \n\
 If FILE not given, uses /etc/utmp.  /etc/wtmp as FILE is common.\n\
 If ARG1 ARG2 given, -m presumed: `am i' or `mom likes' are usual.\n\
-");
+"));
     }
   exit (status);
 }
@@ -538,17 +538,17 @@ usage (status)
      int status;
 {
   if (status != 0)
-    fprintf (stderr, "Try `%s --help' for more information.\n",
+    fprintf (stderr, _("Try `%s --help' for more information.\n"),
             program_name);
   else
     {
-      printf ("Usage: %s [OPTION]... [ FILE ]\n", program_name);
-      printf ("\
+      printf (_("Usage: %s [OPTION]... [ FILE ]\n"), program_name);
+      printf (_("\
 Output who is currently logged in according to FILE.\n\
 If FILE not given, uses /etc/utmp.  /etc/wtmp as FILE is common.\n\
 \n\
       --help        display this help and exit\n\
-      --version     output version information and exit\n");
+      --version     output version information and exit\n"));
     }
   exit (status);
 }
@@ -606,7 +606,7 @@ main (argc, argv)
 #endif /* WHO */
 
        default:
-         error (0, 0, "too many arguments");
+         error (0, 0, _("too many arguments"));
          usage (1);
        }
     }
index 0b48479..2a7b45e 100644 (file)
@@ -48,17 +48,17 @@ usage (status)
      int status;
 {
   if (status != 0)
-    fprintf (stderr, "Try `%s --help' for more information.\n",
+    fprintf (stderr, _("Try `%s --help' for more information.\n"),
             program_name);
   else
     {
-      printf ("Usage: %s [OPTION]...\n", program_name);
-      printf ("\
+      printf (_("Usage: %s [OPTION]...\n"), program_name);
+      printf (_("\
 Print the user name associated with the current effective user id.\n\
 Same as id -un.\n\
 \n\
   --help      display this help and exit\n\
-  --version   output version information and exit\n");
+  --version   output version information and exit\n"));
     }
   exit (status);
 }
@@ -106,7 +106,7 @@ main (argc, argv)
       puts (pw->pw_name);
       exit (0);
     }
-  fprintf (stderr, "%s: cannot find username for UID %u\n",
+  fprintf (stderr, _("%s: cannot find username for UID %u\n"),
           program_name, (unsigned) uid);
   exit (1);
 }
index 1293fad..406c72b 100644 (file)
--- a/src/yes.c
+++ b/src/yes.c
@@ -32,16 +32,16 @@ usage (status)
      int status;
 {
   if (status != 0)
-    fprintf (stderr, "Try `%s --help' for more information.\n",
+    fprintf (stderr, _("Try `%s --help' for more information.\n"),
             program_name);
   else
     {
-      printf ("Usage: %s [OPTION]... [STRING]...\n", program_name);
-      printf ("\
+      printf (_("Usage: %s [OPTION]... [STRING]...\n"), program_name);
+      printf (_("\
 Repeatedly output a line with all specified STRING(s), or `y'.\n\
 \n\
   --help      display this help and exit\n\
-  --version   output version information and exit\n");
+  --version   output version information and exit\n"));
     }
   exit (status);
 }