1 /* Example for use of GNU gettext.
2 This file is in the public domain.
4 Source code of the C program. */
7 /* Get setlocale() declaration. */
10 /* Get printf() declaration. */
13 /* Get getpid() declaration. */
18 /* Get gettext(), textdomain(), bindtextdomain() declaration. */
20 /* Define shortcut for gettext(). */
21 #define _(string) gettext (string)
26 setlocale (LC_ALL
, "");
27 textdomain ("hello-c");
28 bindtextdomain ("hello-c", LOCALEDIR
);
30 printf ("%s\n", _("Hello, world!"));
31 printf (_("This program is running as process number %d."), getpid ());