Next: Python, Up: Individual Programming Languages [Contents][Index]
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_
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}"
autoconf (gettext.m4) and #if ENABLE_NLS
yes
The following examples are available in the examples directory:
hello-c
, hello-c-gnome
, hello-c++
, hello-c++-qt
,
hello-c++-kde
, hello-c++-gnome
, hello-c++-wxwidgets
,
hello-objc
, hello-objc-gnustep
, hello-objc-gnome
.