gettext: C
1
1 15.5.1 C, C++, Objective C
1 --------------------------
1
1 RPMs
1 gcc, gpp, gobjc, glibc, gettext
1
1 File extension
1 For C: ‘c’, ‘h’.
1 For C++: ‘C’, ‘c++’, ‘cc’, ‘cxx’, ‘cpp’, ‘hpp’.
1 For Objective C: ‘m’.
1
1 String syntax
1 ‘"abc"’
1
1 gettext shorthand
1 ‘_("abc")’
1
1 gettext/ngettext functions
1 ‘gettext’, ‘dgettext’, ‘dcgettext’, ‘ngettext’, ‘dngettext’,
1 ‘dcngettext’
1
1 textdomain
1 ‘textdomain’ function
1
1 bindtextdomain
1 ‘bindtextdomain’ function
1
1 setlocale
1 Programmer must call ‘setlocale (LC_ALL, "")’
1
1 Prerequisite
1 ‘#include <libintl.h>’
1 ‘#include <locale.h>’
1 ‘#define _(string) gettext (string)’
1
1 Use or emulate GNU gettext
1 Use
1
1 Extractor
1 ‘xgettext -k_’
1
1 Formatting with positions
1 ‘fprintf "%2$d %1$d"’
11 In C++: ‘autosprintf "%2$d %1$d"’ (⇒Introduction
(autosprintf)Top.)
1
1 Portability
1 autoconf (gettext.m4) and #if ENABLE_NLS
1
1 po-mode marking
1 yes
1
1 The following examples are available in the ‘examples’ directory:
1 ‘hello-c’, ‘hello-c-gnome’, ‘hello-c++’, ‘hello-c++-qt’,
1 ‘hello-c++-kde’, ‘hello-c++-gnome’, ‘hello-c++-wxwidgets’, ‘hello-objc’,
1 ‘hello-objc-gnustep’, ‘hello-objc-gnome’.
1