diff options
author | Karel Zak <kzak@redhat.com> | 2008-09-10 16:03:43 +0200 |
---|---|---|
committer | Karel Zak <kzak@redhat.com> | 2008-09-10 16:03:43 +0200 |
commit | f635c336c45c1c998ace05c37a83cab5d398bee9 (patch) | |
tree | f9b4d8cc8e1373b62957957d6a8590e41158c6bd /sys-utils | |
parent | cc41c0a33e3ef408c0b3df3a676b991dcc3fe06b (diff) | |
download | util-linux-old-f635c336c45c1c998ace05c37a83cab5d398bee9.tar.gz |
ipcmk: add NLS support
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'sys-utils')
-rw-r--r-- | sys-utils/ipcmk.c | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/sys-utils/ipcmk.c b/sys-utils/ipcmk.c index 98ad02d0..2e663bf0 100644 --- a/sys-utils/ipcmk.c +++ b/sys-utils/ipcmk.c @@ -33,6 +33,8 @@ #include <sys/sem.h> #include <sys/msg.h> +#include "nls.h" + static const char *progname; key_t createKey(void) @@ -79,13 +81,13 @@ int createSem(int nsems, int permission) void usage(int rc) { - printf("\nUsage: %s [options]\n\n", progname); - printf( + printf(_("\nUsage: %s [options]\n\n"), progname); + printf(_( " -M <size> create shared memory segment of size <size>\n" " -S <nsems> create semaphore array with <nsems> elements\n" " -Q create message queue\n" - " -p <mode> permission for the resource (default is 0644)\n"); - printf("\nFor more information see ipcmk(1).\n\n"); + " -p <mode> permission for the resource (default is 0644)\n")); + printf(_("\nFor more information see ipcmk(1).\n\n")); exit(rc); } @@ -102,6 +104,10 @@ int main(int argc, char **argv) if (!progname) progname = "ipcmk"; + setlocale(LC_ALL, ""); + bindtextdomain(PACKAGE, LOCALEDIR); + textdomain(PACKAGE); + while((opt = getopt(argc, argv, "hM:QS:p:")) != -1) { switch(opt) { case 'M': @@ -133,25 +139,25 @@ int main(int argc, char **argv) if (doShm) { int shmid; if (-1 == (shmid = createShm(size, permission))) - err(EXIT_FAILURE, "create share memory failed"); + err(EXIT_FAILURE, _("create share memory failed")); else - printf("Shared memory id: %d\n", shmid); + printf(_("Shared memory id: %d\n"), shmid); } if (doMsg) { int msgid; if (-1 == (msgid = createMsg(permission))) - err(EXIT_FAILURE, "create message queue failed"); + err(EXIT_FAILURE, _("create message queue failed")); else - printf("Message queue id: %d\n", msgid); + printf(_("Message queue id: %d\n"), msgid); } if (doSem) { int semid; if (-1 == (semid = createSem(nsems, permission))) - err(EXIT_FAILURE, "create semaphore failed"); + err(EXIT_FAILURE, _("create semaphore failed")); else - printf("Semaphore id: %d\n", semid); + printf(_("Semaphore id: %d\n"), semid); } return EXIT_SUCCESS; |