1Dpkg::Gettext(3)                 libdpkg-perl                 Dpkg::Gettext(3)
2
3
4

NAME

6       Dpkg::Gettext - convenience wrapper around Locale::gettext
7

DESCRIPTION

9       The Dpkg::Gettext module is a convenience wrapper over the
10       Locale::gettext module, to guarantee we always have working gettext
11       functions, and to add some commonly used aliases.
12

VARIABLES

14       $Dpkg::Gettext::DEFAULT_TEXT_DOMAIN
15           Specifies the default text domain name to be used with the short
16           function aliases. This is intended to be used by the Dpkg modules,
17           so that they can produce localized messages even when the calling
18           program has set the current domain with textdomain(). If you would
19           like to use the aliases for your own modules, you might want to set
20           this variable to undef, or to another domain, but then the Dpkg
21           modules will not produce localized messages.
22

FUNCTIONS

24       $trans = g_($msgid)
25           Calls dgettext() on the $msgid and returns its translation for the
26           current locale. If dgettext() is not available, simply returns
27           $msgid.
28
29       $trans = C_($msgctxt, $msgid)
30           Calls dgettext() on the $msgid and returns its translation for the
31           specific $msgctxt supplied. If dgettext() is not available, simply
32           returns $msgid.
33
34       $trans = P_($msgid, $msgid_plural, $n)
35           Calls dngettext(), returning the correct translation for the plural
36           form dependent on $n. If dngettext() is not available, returns
37           $msgid if $n is 1 or $msgid_plural otherwise.
38
39       $msgid = N_($msgid)
40           A pseudo function that servers as a marked for automated extraction
41           of messages, but does not call gettext(). The run-time translation
42           is done at a different place in the code.
43

CHANGES

45   Version 1.02 (dpkg 1.18.3)
46       New function: N_().
47
48   Version 1.01 (dpkg 1.18.0)
49       Now the short aliases (g_ and P_) will call domain aware functions with
50       $DEFAULT_TEXT_DOMAIN.
51
52       New functions: g_(), C_().
53
54       Deprecated function: _g().
55
56   Version 1.00 (dpkg 1.15.6)
57       Mark the module as public.
58
59
60
611.18.25                           2018-06-26                  Dpkg::Gettext(3)
Impressum