summaryrefslogtreecommitdiff
path: root/libshouldbeinlibc/argp-parse.c
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1997-02-14 23:52:24 +0000
committerMiles Bader <miles@gnu.org>1997-02-14 23:52:24 +0000
commit869d0d6a85aa1fda362c35276517c25498ffe086 (patch)
tree1f500ba78bc41263fd8d25d1634b06a7fadf4755 /libshouldbeinlibc/argp-parse.c
parent0b22ff087a71966159da58aa18ccc32091275b74 (diff)
(parser_finalize, argp_version_parser):
Call gettext in appropriate places.
Diffstat (limited to 'libshouldbeinlibc/argp-parse.c')
-rw-r--r--libshouldbeinlibc/argp-parse.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/libshouldbeinlibc/argp-parse.c b/libshouldbeinlibc/argp-parse.c
index a6e4edb3..66b86e66 100644
--- a/libshouldbeinlibc/argp-parse.c
+++ b/libshouldbeinlibc/argp-parse.c
@@ -28,6 +28,18 @@
#include <limits.h>
#include <getopt.h>
+#ifndef _
+/* This is for other GNU distributions with internationalized messages.
+ When compiling libc, the _ macro is predefined. */
+#ifdef HAVE_LIBINTL_H
+# include <libintl.h>
+# define _(msgid) gettext (msgid)
+#else
+# define _(msgid) (msgid)
+# define gettext(msgid) (msgid)
+#endif
+#endif
+
#if _LIBC - 0
#include <libc-lock.h>
#else
@@ -144,7 +156,7 @@ argp_version_parser (int key, char *arg, struct argp_state *state)
else if (argp_program_version)
fprintf (state->out_stream, "%s\n", argp_program_version);
else
- __argp_error (state, "No version known!?");
+ __argp_error (state, gettext ("No version known!?"));
if (! (state->flags & ARGP_NO_EXIT))
exit (0);
break;
@@ -596,7 +608,7 @@ parser_finalize (struct parser *parser,
{
if (!(parser->state.flags & ARGP_NO_ERRS) && parser->state.err_stream)
fprintf (parser->state.err_stream,
- "%s: Too many arguments\n", parser->state.name);
+ gettext ("%s: Too many arguments\n"), parser->state.name);
err = EBADKEY;
}