180 lines
4.3 KiB
HTML
180 lines
4.3 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of Dpkg::Gettext</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>Dpkg::Gettext</H1>
|
|
Section: libdpkg-perl (3perl)<BR>Updated: 2020-03-23<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
Dpkg::Gettext - convenience wrapper around Locale::gettext
|
|
<A NAME="lbAC"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
|
|
|
|
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.
|
|
<A NAME="lbAD"> </A>
|
|
<H2>ENVIRONMENT</H2>
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="1"><FONT SIZE="-1">DPKG_NLS</FONT><DD>
|
|
|
|
|
|
When set to 0, this environment variable will disable the National Language
|
|
Support in all Dpkg modules.
|
|
</DL>
|
|
<A NAME="lbAE"> </A>
|
|
<H2>VARIABLES</H2>
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="2">$Dpkg::Gettext::DEFAULT_TEXT_DOMAIN<DD>
|
|
|
|
|
|
|
|
|
|
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 <B>textdomain()</B>. 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.
|
|
</DL>
|
|
<A NAME="lbAF"> </A>
|
|
<H2>FUNCTIONS</H2>
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="3">$domain = textdomain($new_domain)<DD>
|
|
|
|
|
|
|
|
|
|
Compatibility <B>textdomain()</B> fallback when Locale::gettext is not available.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If <TT>$new_domain</TT> is not undef, it will set the current domain to <TT>$new_domain</TT>.
|
|
Returns the current domain, after possibly changing it.
|
|
<DT id="4">$trans = ngettext($msgid, $msgid_plural, $n)<DD>
|
|
|
|
|
|
|
|
|
|
Compatibility <B>ngettext()</B> fallback when Locale::gettext is not available.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Returns <TT>$msgid</TT> if <TT>$n</TT> is 1 or <TT>$msgid_plural</TT> otherwise.
|
|
<DT id="5">$trans = g_($msgid)<DD>
|
|
|
|
|
|
|
|
|
|
Calls <B>dgettext()</B> on the <TT>$msgid</TT> and returns its translation for the current
|
|
locale. If <B>dgettext()</B> is not available, simply returns <TT>$msgid</TT>.
|
|
<DT id="6">$trans = C_($msgctxt, $msgid)<DD>
|
|
|
|
|
|
|
|
|
|
Calls <B>dgettext()</B> on the <TT>$msgid</TT> and returns its translation for the specific
|
|
<TT>$msgctxt</TT> supplied. If <B>dgettext()</B> is not available, simply returns <TT>$msgid</TT>.
|
|
<DT id="7">$trans = P_($msgid, $msgid_plural, $n)<DD>
|
|
|
|
|
|
|
|
|
|
Calls <B>dngettext()</B>, returning the correct translation for the plural form
|
|
dependent on <TT>$n</TT>. If <B>dngettext()</B> is not available, returns <TT>$msgid</TT> if <TT>$n</TT> is 1
|
|
or <TT>$msgid_plural</TT> otherwise.
|
|
<DT id="8">$msgid = N_($msgid)<DD>
|
|
|
|
|
|
|
|
|
|
A pseudo function that servers as a marked for automated extraction of
|
|
messages, but does not call <B>gettext()</B>. The run-time translation is done
|
|
at a different place in the code.
|
|
</DL>
|
|
<A NAME="lbAG"> </A>
|
|
<H2>CHANGES</H2>
|
|
|
|
|
|
|
|
<A NAME="lbAH"> </A>
|
|
<H3>Version 1.03 (dpkg 1.19.0)</H3>
|
|
|
|
|
|
|
|
New envvar: Add support for new <B></B><FONT SIZE="-1"><B>DPKG_NLS</B></FONT><B></B> environment variable.
|
|
<A NAME="lbAI"> </A>
|
|
<H3>Version 1.02 (dpkg 1.18.3)</H3>
|
|
|
|
|
|
|
|
New function: <B>N_()</B>.
|
|
<A NAME="lbAJ"> </A>
|
|
<H3>Version 1.01 (dpkg 1.18.0)</H3>
|
|
|
|
|
|
|
|
Now the short aliases (g_ and P_) will call domain aware functions with
|
|
<TT>$DEFAULT_TEXT_DOMAIN</TT>.
|
|
<P>
|
|
|
|
New functions: <B>g_()</B>, <B>C_()</B>.
|
|
<P>
|
|
|
|
Deprecated function: <B>_g()</B>.
|
|
<A NAME="lbAK"> </A>
|
|
<H3>Version 1.00 (dpkg 1.15.6)</H3>
|
|
|
|
|
|
|
|
Mark the module as public.
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="9"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="10"><A HREF="#lbAC">DESCRIPTION</A><DD>
|
|
<DT id="11"><A HREF="#lbAD">ENVIRONMENT</A><DD>
|
|
<DT id="12"><A HREF="#lbAE">VARIABLES</A><DD>
|
|
<DT id="13"><A HREF="#lbAF">FUNCTIONS</A><DD>
|
|
<DT id="14"><A HREF="#lbAG">CHANGES</A><DD>
|
|
<DL>
|
|
<DT id="15"><A HREF="#lbAH">Version 1.03 (dpkg 1.19.0)</A><DD>
|
|
<DT id="16"><A HREF="#lbAI">Version 1.02 (dpkg 1.18.3)</A><DD>
|
|
<DT id="17"><A HREF="#lbAJ">Version 1.01 (dpkg 1.18.0)</A><DD>
|
|
<DT id="18"><A HREF="#lbAK">Version 1.00 (dpkg 1.15.6)</A><DD>
|
|
</DL>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:05:39 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|