gcc, gpp, gobjc, glibc, gettext
gcc, g++, gobjc, libc6-dev, libasprintf-dev
For C: c, h.
For C++: C, c++, cc, cxx, cpp, hpp.
For Objective C: m.
"abc"
_("abc")
gettext, dgettext, dcgettext, ngettext,
dngettext, dcngettext
textdomain function
bindtextdomain and wbindtextdomain functions
Programmer must call setlocale (LC_ALL, "")
#include <libintl.h>
#include <locale.h>
#define _(string) gettext (string)
Use
xgettext -k_
For C++ with the Boost library: xgettext --boost -k_
fprintf "%2$d %1$d"
In C++: autosprintf "%2$d %1$d"
(see Introduction in GNU autosprintf)
In C++ 20 or newer: std::vformat "{1} {0}"
In C++ with the Boost library: boost::format "%2% %1%"
autoconf (gettext.m4) and #if ENABLE_NLS
yes
The following examples are available in the examples directory:
hello-c, hello-c-gnome2, hello-c-gnome3, hello-c-http,
hello-c++, hello-c++20,
hello-c++-qt, hello-c++-kde,
hello-c++-gnome2, hello-c++-gnome3, hello-c++-wxwidgets,
hello-objc, hello-objc-gnustep, hello-objc-gnome2.