mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Expose C library's gettext. Fixes #516412.
This commit is contained in:
parent
4208d4f757
commit
2e64c34850
6 changed files with 448 additions and 342 deletions
|
@ -467,3 +467,21 @@ application doesn't want this to happen, it should remove the
|
|||
\module{_locale} extension module (which does all the work) from the
|
||||
table of built-in modules in the \file{config.c} file, and make sure
|
||||
that the \module{_locale} module is not accessible as a shared library.
|
||||
|
||||
\subsection{Access to message catalogs}
|
||||
|
||||
The locale module exposes the C library's gettext interface on systems
|
||||
that provide this interface. It consists of the functions
|
||||
\function{gettext}, \function{dgettext}, \function{dcgettext},
|
||||
\function{textdomain}, and \function{bindtextdomain}. These are
|
||||
similar to the same functions in the \module{gettext} module, but use
|
||||
the C library's binary format for message catalogs, and the C
|
||||
library's search algorithms for locating message catalogs.
|
||||
|
||||
Python applications should normally find no need to invoke these
|
||||
functions, and should use \module{gettext} instead. A known exception
|
||||
to this rule are applications that link use additional C libraries
|
||||
which internally invoke \function{gettext} or \function{dgettext}. For
|
||||
these applications, it may be necessary to bind the text domain, so
|
||||
that the libraries can properly locate their message catalogs.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue