From f4e6b3c7cf96d211f211bcb3ca1012dcfcc23332 Mon Sep 17 00:00:00 2001 From: Craig Small Date: Wed, 3 Nov 2004 21:32:15 +0000 Subject: [PATCH] nls and double bracket fixes --- ChangeLog | 1 + src/fuser.c | 2 +- src/killall.c | 58 +++++++++++++++++++++++++-------------------------- src/pstree.c | 6 ++++-- src/signals.c | 9 +++++++- 5 files changed, 43 insertions(+), 33 deletions(-) diff --git a/ChangeLog b/ChangeLog index fc22e53..c4efc05 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,7 @@ Changes in 21.6 (not released yet) * Added closing bracket in fuser help * Added Finnish translation * Localised the yes/no prompts with rpmatch() + * Fixed NLS problems and some double ))s - Thanks to Jakub Bogusz Changes in 21.5 =============== diff --git a/src/fuser.c b/src/fuser.c index d537db2..6a4fc36 100644 --- a/src/fuser.c +++ b/src/fuser.c @@ -668,7 +668,7 @@ show_files_or_kill (void) { if (header && (file->flags & FLAG_VERB)) { - fprintf (stderr, "\n%*s USER PID ACCESS COMMAND\n", NAME_FIELD, ""); + fprintf (stderr, _("\n%*s USER PID ACCESS COMMAND\n"), NAME_FIELD, ""); header = 0; } length = 0; diff --git a/src/killall.c b/src/killall.c index 96617d9..6a75524 100644 --- a/src/killall.c +++ b/src/killall.c @@ -390,13 +390,13 @@ kill_all (int signal, int names, char **namelist) static void usage_pidof (void) { - fprintf (stderr, "usage: pidof [ -eg ] name ...\n"); - fprintf (stderr, " pidof -V\n\n"); - fprintf (stderr, " -e require exact match for very long names;\n"); - fprintf (stderr, " skip if the command line is unavailable\n"); + fprintf (stderr, _("usage: pidof [ -eg ] name ...\n")); + fprintf (stderr, _(" pidof -V\n\n")); + fprintf (stderr, _(" -e require exact match for very long names;\n")); + fprintf (stderr, _(" skip if the command line is unavailable\n")); fprintf (stderr, - " -g show process group ID instead of process ID\n"); - fprintf (stderr, " -V display version information\n\n"); + _(" -g show process group ID instead of process ID\n")); + fprintf (stderr, _(" -V display version information\n\n")); } @@ -404,26 +404,26 @@ static void usage_killall (void) { #ifdef FLASK_LINUX - fprintf(stderr,"Usage: killall [-s sid] [-c context] [ -egiqvw ] [ -signal ] name ...\n"); + fprintf(stderr,_("Usage: killall [-s sid] [-c context] [ -egiqvw ] [ -signal ] name ...\n")); #else /*FLASK_LINUX*/ - fprintf (stderr, "usage: killall [ OPTIONS ] [ -- ] name ...\n"); + fprintf (stderr, _("usage: killall [ OPTIONS ] [ -- ] name ...\n")); #endif /*FLASK_LINUX*/ - fprintf (stderr, " killall -l, --list\n"); - fprintf (stderr, " killall -V --version\n\n"); - fprintf (stderr, " -e,--exact require exact match for very long names\n"); - fprintf (stderr, " -I,--ignore-case- case insensitive process name match\n"); - fprintf (stderr, " -g,--process-group kill process group instead of process\n"); - fprintf (stderr, " -i,--interactive ask for confirmation before killing\n"); - fprintf (stderr, " -l,--list list all known signal names\n"); - fprintf (stderr, " -q,--quiet don't print complaints\n"); - fprintf (stderr, " -s,--signal send signal instead of SIGTERM\n"); - fprintf (stderr, " -v,--verbose report if the signal was successfully sent\n"); - fprintf (stderr, " -V,--version display version information\n"); - fprintf (stderr, " -w,--wait wait for processes to die\n\n"); + fprintf (stderr, _(" killall -l, --list\n")); + fprintf (stderr, _(" killall -V --version\n\n")); + fprintf (stderr, _(" -e,--exact require exact match for very long names\n")); + fprintf (stderr, _(" -I,--ignore-case- case insensitive process name match\n")); + fprintf (stderr, _(" -g,--process-group kill process group instead of process\n")); + fprintf (stderr, _(" -i,--interactive ask for confirmation before killing\n")); + fprintf (stderr, _(" -l,--list list all known signal names\n")); + fprintf (stderr, _(" -q,--quiet don't print complaints\n")); + fprintf (stderr, _(" -s,--signal send signal instead of SIGTERM\n")); + fprintf (stderr, _(" -v,--verbose report if the signal was successfully sent\n")); + fprintf (stderr, _(" -V,--version display version information\n")); + fprintf (stderr, _(" -w,--wait wait for processes to die\n\n")); #ifdef FLASK_LINUX - fprintf (stderr, " -d,--sid kill only process(es) having sid\n"); - fprintf (stderr, " -c,--context kill only process(es) having scontext\n"); - fprintf(stderr, " (-s, -c are mutually exclusive and must precede other arguments)\n\n"); + fprintf (stderr, _(" -d,--sid kill only process(es) having sid\n")); + fprintf (stderr, _(" -c,--context kill only process(es) having scontext\n")); + fprintf(stderr, _(" (-s, -c are mutually exclusive and must precede other arguments)\n\n")); #endif /*FLASK_LINUX*/ } @@ -441,11 +441,11 @@ usage (void) void print_version() { fprintf(stderr, "%s (psmisc) %s\n", pidof ? "pidof" : "killall", VERSION); - fprintf(stderr, "Copyright (C) 1993-2002 Werner Almesberger and Craig Small\n\n"); - fprintf(stderr, "PSmisc comes with ABSOLUTELY NO WARRANTY.\n"); - fprintf(stderr, "This is free software, and you are welcome to redistribute it under the terms\n"); - fprintf(stderr, "of the GNU General Public License.\n"); - fprintf(stderr, "For more information about these matters, see the files named COPYING.\n"); + fprintf(stderr, _("Copyright (C) 1993-2002 Werner Almesberger and Craig Small\n\n")); + fprintf(stderr, _("PSmisc comes with ABSOLUTELY NO WARRANTY.\n")); + fprintf(stderr, _("This is free software, and you are welcome to redistribute it under the terms\n")); + fprintf(stderr, _("of the GNU General Public License.\n")); + fprintf(stderr, _("For more information about these matters, see the files named COPYING.\n")); } int @@ -559,7 +559,7 @@ main (int argc, char **argv) lsid = strtol(optarg, buf, 0); if ( **buf ) { - (void) fprintf(stderr, "%s: SID (%s) must be numeric\n", name, *argv); + (void) fprintf(stderr, _("%s: SID (%s) must be numeric\n"), name, *argv); (void) fflush(stderr); return( 1 ); } diff --git a/src/pstree.c b/src/pstree.c index 50fcff9..618fa7f 100644 --- a/src/pstree.c +++ b/src/pstree.c @@ -733,9 +733,9 @@ usage (void) fprintf (stderr, _(" -s show Flask SIDs\n")); fprintf (stderr, _(" -x show Flask security contexts\n")); #endif /*FLASK_LINUX*/ - fprintf (stderr, _(" -U use UTF-8 (Unicode)) line drawing characters\n")); + fprintf (stderr, _(" -U use UTF-8 (Unicode) line drawing characters\n")); fprintf (stderr, _(" -V display version information\n")); - fprintf (stderr, _(" pid start at pid, default 1 (init))\n")); + fprintf (stderr, _(" pid start at pid, default 1 (init)\n")); fprintf (stderr, _(" user show only trees rooted at processes of that user\n\n")); exit (1); } @@ -772,6 +772,8 @@ main (int argc, char **argv) #ifdef ENABLE_NLS setlocale(LC_ALL, ""); + bindtextdomain(PACKAGE, LOCALEDIR); + textdomain(PACKAGE); #endif if ( (tmpstr = strrchr(argv[0],'/'))) { diff --git a/src/signals.c b/src/signals.c index a8295d3..69949ea 100644 --- a/src/signals.c +++ b/src/signals.c @@ -8,6 +8,13 @@ #include #include #include +#ifdef ENABLE_NLS +#include +#include +#define _(String) gettext (String) +#else +#define _(String) (String) +#endif #include "signals.h" @@ -60,6 +67,6 @@ get_signal (char *name, const char *cmd) break; if (walk->name) return walk->number; - fprintf (stderr, "%s: unknown signal; %s -l lists signals.\n", name, cmd); + fprintf (stderr, _("%s: unknown signal; %s -l lists signals.\n"), name, cmd); exit (1); } -- 2.40.0