@@ -219,13 +219,16 @@ \subsection{Class-based API}
219219\end {funcdesc }
220220
221221\begin {funcdesc }{install}{domain\optional {, localedir\optional {, unicode
222- \optional {, codeset}}}}
222+ \optional {, codeset\optional {, names} }}}}
223223This installs the function \function {_} in Python's builtin namespace,
224224based on \var {domain}, \var {localedir}, and \var {codeset} which are
225225passed to the function \function {translation()}. The \var {unicode}
226226flag is passed to the resulting translation object's \method {install}
227227method.
228228
229+ For the \var {names} parameter, please see the description of the
230+ translation object's \method {install} method.
231+
229232As seen below, you usually mark the strings in your application that are
230233candidates for translation, by wrapping them in a call to the
231234\function {_()} function, like this:
@@ -239,6 +242,7 @@ \subsection{Class-based API}
239242of your application.
240243
241244\versionchanged [Added the \var {codeset} parameter]{2.4}
245+ \versionchanged [Added the \var {names} parameter]{2.5}
242246\end {funcdesc }
243247
244248\subsubsection {The \class {NullTranslations} class }
@@ -332,12 +336,21 @@ \subsubsection{The \class{NullTranslations} class}
332336\versionadded {2.4}
333337\end {methoddesc }
334338
335- \begin {methoddesc }[NullTranslations]{install}{\optional {unicode}}
339+ \begin {methoddesc }[NullTranslations]{install}{\optional {unicode
340+ \optional {, names}}}
336341If the \var {unicode} flag is false, this method installs
337342\method {self.gettext()} into the built-in namespace, binding it to
338343\samp {_}. If \var {unicode} is true, it binds \method {self.ugettext()}
339344instead. By default, \var {unicode} is false.
340345
346+ If the \var {names} parameter is given, it must be a sequence containing
347+ the names of functions you want to install in the builtin namespace in
348+ addition to \function {_()}. Supported names are \code {'gettext'} (bound
349+ to \method {self.gettext()} or \method {self.ugettext()} according to the
350+ \var {unicode} flag), \code {'ngettext'} (bound to \method {self.ngettext()}
351+ or \method {self.ungettext()} according to the \var {unicode} flag),
352+ \code {'lgettext'} and \code {'lngettext'}.
353+
341354Note that this is only one way, albeit the most convenient way, to
342355make the \function {_} function available to your application. Because it
343356affects the entire application globally, and specifically the built-in
@@ -353,6 +366,8 @@ \subsubsection{The \class{NullTranslations} class}
353366
354367This puts \function {_} only in the module's global namespace and so
355368only affects calls within this module.
369+
370+ \versionchanged [Added the \var {names} parameter]{2.5}
356371\end {methoddesc }
357372
358373\subsubsection {The \class {GNUTranslations} class }
0 commit comments