.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Dpkg::Gettext 3perl" .TH Dpkg::Gettext 3perl 2024-03-10 1.22.6 libdpkg-perl .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Dpkg::Gettext \- convenience wrapper around Locale::gettext .SH DESCRIPTION .IX Header "DESCRIPTION" The Dpkg::Gettext module is a convenience wrapper over the Locale::gettext module, to guarantee we always have working gettext functions, and to add some commonly used aliases. .SH ENVIRONMENT .IX Header "ENVIRONMENT" .IP DPKG_NLS 4 .IX Item "DPKG_NLS" When set to 0, this environment variable will disable the National Language Support in all Dpkg modules. .SH VARIABLES .IX Header "VARIABLES" .ie n .IP $Dpkg::Gettext::DEFAULT_TEXT_DOMAIN 4 .el .IP \f(CW$Dpkg::Gettext::DEFAULT_TEXT_DOMAIN\fR 4 .IX Item "$Dpkg::Gettext::DEFAULT_TEXT_DOMAIN" Specifies the default text domain name to be used with the short function aliases. This is intended to be used by the Dpkg modules, so that they can produce localized messages even when the calling program has set the current domain with \fBtextdomain()\fR. If you would like to use the aliases for your own modules, you might want to set this variable to undef, or to another domain, but then the Dpkg modules will not produce localized messages. .SH FUNCTIONS .IX Header "FUNCTIONS" .ie n .IP "$domain = textdomain($new_domain)" 4 .el .IP "\f(CW$domain\fR = textdomain($new_domain)" 4 .IX Item "$domain = textdomain($new_domain)" Compatibility \fBtextdomain()\fR fallback when Locale::gettext is not available. .Sp If \f(CW$new_domain\fR is not undef, it will set the current domain to \f(CW$new_domain\fR. Returns the current domain, after possibly changing it. .ie n .IP "$trans = gettext($msgid)" 4 .el .IP "\f(CW$trans\fR = gettext($msgid)" 4 .IX Item "$trans = gettext($msgid)" Compatibility \fBgettext()\fR fallback when Locale::gettext is not available. .Sp Returns \f(CW$msgid\fR. .ie n .IP "$trans = ngettext($msgid, $msgid_plural, $n)" 4 .el .IP "\f(CW$trans\fR = ngettext($msgid, \f(CW$msgid_plural\fR, \f(CW$n\fR)" 4 .IX Item "$trans = ngettext($msgid, $msgid_plural, $n)" Compatibility \fBngettext()\fR fallback when Locale::gettext is not available. .Sp Returns \f(CW$msgid\fR if \f(CW$n\fR is 1 or \f(CW$msgid_plural\fR otherwise. .ie n .IP "$trans = g_($msgid)" 4 .el .IP "\f(CW$trans\fR = g_($msgid)" 4 .IX Item "$trans = g_($msgid)" Calls \fBdgettext()\fR on the \f(CW$msgid\fR and returns its translation for the current locale. If \fBdgettext()\fR is not available, simply returns \f(CW$msgid\fR. .ie n .IP "$trans = C_($msgctxt, $msgid)" 4 .el .IP "\f(CW$trans\fR = C_($msgctxt, \f(CW$msgid\fR)" 4 .IX Item "$trans = C_($msgctxt, $msgid)" Calls \fBdgettext()\fR on the \f(CW$msgid\fR and returns its translation for the specific \&\f(CW$msgctxt\fR supplied. If \fBdgettext()\fR is not available, simply returns \f(CW$msgid\fR. .ie n .IP "$trans = P_($msgid, $msgid_plural, $n)" 4 .el .IP "\f(CW$trans\fR = P_($msgid, \f(CW$msgid_plural\fR, \f(CW$n\fR)" 4 .IX Item "$trans = P_($msgid, $msgid_plural, $n)" Calls \fBdngettext()\fR, returning the correct translation for the plural form dependent on \f(CW$n\fR. If \fBdngettext()\fR is not available, returns \f(CW$msgid\fR if \f(CW$n\fR is 1 or \f(CW$msgid_plural\fR otherwise. .ie n .IP "$msgid = N_($msgid)" 4 .el .IP "\f(CW$msgid\fR = N_($msgid)" 4 .IX Item "$msgid = N_($msgid)" A pseudo function that servers as a marker for automated extraction of messages, but does not call \fBgettext()\fR. The run-time translation is done at a different place in the code. .SH CHANGES .IX Header "CHANGES" .SS "Version 2.01 (dpkg 1.21.10)" .IX Subsection "Version 2.01 (dpkg 1.21.10)" New function: \fBgettext()\fR. .SS "Version 2.00 (dpkg 1.20.0)" .IX Subsection "Version 2.00 (dpkg 1.20.0)" Remove function: \fB_g()\fR. .SS "Version 1.03 (dpkg 1.19.0)" .IX Subsection "Version 1.03 (dpkg 1.19.0)" New envvar: Add support for new \fBDPKG_NLS\fR environment variable. .SS "Version 1.02 (dpkg 1.18.3)" .IX Subsection "Version 1.02 (dpkg 1.18.3)" New function: \fBN_()\fR. .SS "Version 1.01 (dpkg 1.18.0)" .IX Subsection "Version 1.01 (dpkg 1.18.0)" Now the short aliases (g_ and P_) will call domain aware functions with \&\f(CW$DEFAULT_TEXT_DOMAIN\fR. .PP New functions: \fBg_()\fR, \fBC_()\fR. .PP Deprecated function: \fB_g()\fR. .SS "Version 1.00 (dpkg 1.15.6)" .IX Subsection "Version 1.00 (dpkg 1.15.6)" Mark the module as public.