Print this page
make: translate using gettext, rather than the unmaintainable catgets

@@ -21,23 +21,22 @@
 /*
  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  * Use is subject to license terms.
  */
 
-#include <avo/intl.h>   /* for NOCATGETS */
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <sys/errno.h>
 #include <sys/param.h>
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <unistd.h>
 #include <vroot/vroot.h>
-#include <mksdmsi18n/mksdmsi18n.h>
 #include <signal.h>
 #include <errno.h>                      /* errno */
+#include <libintl.h>
 
 extern  char            *sys_errlist[];
 extern  int             sys_nerr;
 
 static  void            file_lock_error(char *msg, char *file, char *str, int arg1, int arg2);

@@ -107,11 +106,11 @@
                         return 0; /* success */
                 }
                 UNBLOCK_INTERUPTS;
 
                 if (errno != EEXIST) {
-                        file_lock_error(msg, name, (char *)NOCATGETS("symlink(%s, %s)"),
+                        file_lock_error(msg, name, (char *)"symlink(%s, %s)",
                             (int) name, (int) lockname);
                         fprintf(stderr, "%s", msg);
                         return errno;
                 }
 

@@ -129,17 +128,17 @@
 
                         if ((counter > 5) && (!printed_warning)) {
                                 /* Print waiting message after 5 secs */
                                 (void) getcwd(msg, MAXPATHLEN);
                                 fprintf(stderr,
-                                        catgets(libmksdmsi18n_catd, 1, 162, "file_lock: file %s is already locked.\n"),
+                                        gettext("file_lock: file %s is already locked.\n"),
                                         name);
                                 fprintf(stderr,
-                                        catgets(libmksdmsi18n_catd, 1, 163, "file_lock: will periodically check the lockfile %s for two minutes.\n"),
+                                        gettext("file_lock: will periodically check the lockfile %s for two minutes.\n"),
                                         lockname);
                                 fprintf(stderr,
-                                        catgets(libmksdmsi18n_catd, 1, 144, "Current working directory %s\n"),
+                                        gettext("Current working directory %s\n"),
                                         msg);
 
                                 printed_warning = 1;
                         }
 

@@ -160,17 +159,17 @@
 static  void
 file_lock_error(char *msg, char *file, char *str, int arg1, int arg2)
 {
         int             len;
 
-        sprintf(msg, catgets(libmksdmsi18n_catd, 1, 145, "Could not lock file `%s'; "), file);
+        sprintf(msg, gettext("Could not lock file `%s'; "), file);
         len = strlen(msg);
         sprintf(&msg[len], str, arg1, arg2);
-        strcat(msg, catgets(libmksdmsi18n_catd, 1, 146, " failed - "));
+        strcat(msg, gettext(" failed - "));
         if (errno < sys_nerr) {
                 strcat(msg, strerror(errno));
         } else {
                 len = strlen(msg);
-                sprintf(&msg[len], NOCATGETS("errno %d"), errno);
+                sprintf(&msg[len], "errno %d", errno);
         }
 }