1 /* Example for use of GNU gettext.
2 Copyright (C) 2003 Free Software Foundation, Inc.
3 This file is in the public domain.
5 Source code of the C program. */
8 /* Get setlocale() declaration. */
11 /* Get printf() declaration. */
14 /* Get getpid() declaration. */
19 /* Get gettext(), textdomain(), bindtextdomain() declaration. */
21 /* Define shortcut for gettext(). */
22 #define _(string) gettext (string)
27 setlocale (LC_ALL
, "");
28 textdomain ("hello-c");
29 bindtextdomain ("hello-c", LOCALEDIR
);
31 printf ("%s\n", _("Hello, world!"));
32 printf (_("This program is running as process number %d."), getpid ());