1Dpkg::Gettext(3perl)             libdpkg-perl             Dpkg::Gettext(3perl)
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

ENVIRONMENT

14       DPKG_NLS
15           When set to 0, this environment variable will disable the National
16           Language Support in all Dpkg modules.
17

VARIABLES

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

FUNCTIONS

29       $domain = textdomain($new_domain)
30           Compatibility textdomain() fallback when Locale::gettext is not
31           available.
32
33           If $new_domain is not undef, it will set the current domain to
34           $new_domain.  Returns the current domain, after possibly changing
35           it.
36
37       $trans = gettext($msgid)
38           Compatibility gettext() fallback when Locale::gettext is not
39           available.
40
41           Returns $msgid.
42
43       $trans = ngettext($msgid, $msgid_plural, $n)
44           Compatibility ngettext() fallback when Locale::gettext is not
45           available.
46
47           Returns $msgid if $n is 1 or $msgid_plural otherwise.
48
49       $trans = g_($msgid)
50           Calls dgettext() on the $msgid and returns its translation for the
51           current locale. If dgettext() is not available, simply returns
52           $msgid.
53
54       $trans = C_($msgctxt, $msgid)
55           Calls dgettext() on the $msgid and returns its translation for the
56           specific $msgctxt supplied. If dgettext() is not available, simply
57           returns $msgid.
58
59       $trans = P_($msgid, $msgid_plural, $n)
60           Calls dngettext(), returning the correct translation for the plural
61           form dependent on $n. If dngettext() is not available, returns
62           $msgid if $n is 1 or $msgid_plural otherwise.
63
64       $msgid = N_($msgid)
65           A pseudo function that servers as a marker for automated extraction
66           of messages, but does not call gettext(). The run-time translation
67           is done at a different place in the code.
68

CHANGES

70   Version 2.01 (dpkg 1.21.10)
71       New function: gettext().
72
73   Version 2.00 (dpkg 1.20.0)
74       Remove function: _g().
75
76   Version 1.03 (dpkg 1.19.0)
77       New envvar: Add support for new DPKG_NLS environment variable.
78
79   Version 1.02 (dpkg 1.18.3)
80       New function: N_().
81
82   Version 1.01 (dpkg 1.18.0)
83       Now the short aliases (g_ and P_) will call domain aware functions with
84       $DEFAULT_TEXT_DOMAIN.
85
86       New functions: g_(), C_().
87
88       Deprecated function: _g().
89
90   Version 1.00 (dpkg 1.15.6)
91       Mark the module as public.
92
93
94
951.21.21                           2023-03-28              Dpkg::Gettext(3perl)
Impressum