1Dpkg::Gettext(3perl) libdpkg-perl Dpkg::Gettext(3perl)
2
3
4
6 Dpkg::Gettext - convenience wrapper around Locale::gettext
7
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
14 DPKG_NLS
15 When set to 0, this environment variable will disable the National
16 Language Support in all Dpkg modules.
17
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
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 = ngettext($msgid, $msgid_plural, $n)
38 Compatibility ngettext() fallback when Locale::gettext is not
39 available.
40
41 Returns $msgid if $n is 1 or $msgid_plural otherwise.
42
43 $trans = g_($msgid)
44 Calls dgettext() on the $msgid and returns its translation for the
45 current locale. If dgettext() is not available, simply returns
46 $msgid.
47
48 $trans = C_($msgctxt, $msgid)
49 Calls dgettext() on the $msgid and returns its translation for the
50 specific $msgctxt supplied. If dgettext() is not available, simply
51 returns $msgid.
52
53 $trans = P_($msgid, $msgid_plural, $n)
54 Calls dngettext(), returning the correct translation for the plural
55 form dependent on $n. If dngettext() is not available, returns
56 $msgid if $n is 1 or $msgid_plural otherwise.
57
58 $msgid = N_($msgid)
59 A pseudo function that servers as a marked for automated extraction
60 of messages, but does not call gettext(). The run-time translation
61 is done at a different place in the code.
62
64 Version 2.00 (dpkg 1.20.0)
65 Remove function: _g().
66
67 Version 1.03 (dpkg 1.19.0)
68 New envvar: Add support for new DPKG_NLS environment variable.
69
70 Version 1.02 (dpkg 1.18.3)
71 New function: N_().
72
73 Version 1.01 (dpkg 1.18.0)
74 Now the short aliases (g_ and P_) will call domain aware functions with
75 $DEFAULT_TEXT_DOMAIN.
76
77 New functions: g_(), C_().
78
79 Deprecated function: _g().
80
81 Version 1.00 (dpkg 1.15.6)
82 Mark the module as public.
83
84
85
861.20.9 2021-05-10 Dpkg::Gettext(3perl)