1 // Example for use of GNU gettext.
2 // This file is in the public domain.
4 // Source code of the C++ program.
7 // Avoid deprecation warnings from g++ 3.1 or newer.
8 #if defined __GNUG__ && defined __DEPRECATED
12 # include <iostream.h>
15 // Get setlocale() declaration.
18 // Get getpid() declaration.
23 // Get gettext(), textdomain(), bindtextdomain() declaration.
25 // Define shortcut for gettext().
26 #define _(string) gettext (string)
28 // Get autosprintf class declaration.
29 #include "autosprintf.h"
30 using gnu::autosprintf
;
35 setlocale (LC_ALL
, "");
36 textdomain ("hello-c++");
37 bindtextdomain ("hello-c++", LOCALEDIR
);
39 cout
<< _("Hello, world!") << endl
;
40 cout
<< autosprintf (_("This program is running as process number %d."),