Install gettext-0.18.1.1.tar.gz
[msysgit.git] / mingw / share / doc / gettext / examples / hello-objc / hello.m
blob1fca03eea3455a9467e722901a7ed0abafd0627e
1 /* Example for use of GNU gettext.
2    This file is in the public domain.
4    Source code of the Objective-C program.  */
7 /* Get setlocale() declaration.  */
8 #include <locale.h>
10 /* Get printf() declaration.  */
11 #include <stdio.h>
13 /* Get getpid() declaration.  */
14 #if HAVE_UNISTD_H
15 # include <unistd.h>
16 #endif
18 /* Get gettext(), textdomain(), bindtextdomain() declaration.  */
19 #include "gettext.h"
20 /* Define shortcut for gettext().  */
21 #define _(string) gettext (string)
23 int
24 main ()
26   setlocale (LC_ALL, "");
27   textdomain ("hello-objc");
28   bindtextdomain ("hello-objc", LOCALEDIR);
30   printf ("%s\n", _("Hello, world!"));
31   printf (_("This program is running as process number %d."), getpid ());
32   putchar ('\n');
34   return 0;