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 // Avoid deprecation warnings from g++ 3.1 or newer.
9 #if defined __GNUG__ && defined __DEPRECATED
13 # include <iostream.h>
16 // Get setlocale() declaration.
19 // Get getpid() declaration.
24 // Get gettext(), textdomain(), bindtextdomain() declaration.
26 // Define shortcut for gettext().
27 #define _(string) gettext (string)
29 // Get autosprintf class declaration.
30 #include "autosprintf.h"
31 using gnu::autosprintf
;
36 setlocale (LC_ALL
, "");
37 textdomain ("hello-c++");
38 bindtextdomain ("hello-c++", LOCALEDIR
);
40 cout
<< _("Hello, world!") << endl
;
41 cout
<< autosprintf (_("This program is running as process number %d."),