Skip to content

Commit c02a1f4

Browse files
bpo-31667: Fix gettext related links. (#3860)
* Fix incorrect links. * Remove redundant links. * Add signatures and index entries for gettext related functions in the locale module.
1 parent 77732be commit c02a1f4

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

Doc/library/gettext.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ Class-based API
134134

135135
The class-based API of the :mod:`gettext` module gives you more flexibility and
136136
greater convenience than the GNU :program:`gettext` API. It is the recommended
137-
way of localizing your Python applications and modules. :mod:`gettext` defines
137+
way of localizing your Python applications and modules. :mod:`!gettext` defines
138138
a "translations" class which implements the parsing of GNU :file:`.mo` format
139139
files, and has methods for returning strings. Instances of this "translations"
140140
class can also install themselves in the built-in namespace as the function
@@ -219,7 +219,7 @@ Translation classes are what actually implement the translation of original
219219
source file message strings to translated message strings. The base class used
220220
by all translation classes is :class:`NullTranslations`; this provides the basic
221221
interface you can use to write your own specialized translation classes. Here
222-
are the methods of :class:`NullTranslations`:
222+
are the methods of :class:`!NullTranslations`:
223223

224224

225225
.. class:: NullTranslations(fp=None)
@@ -247,21 +247,21 @@ are the methods of :class:`NullTranslations`:
247247

248248
.. method:: gettext(message)
249249

250-
If a fallback has been set, forward :meth:`.gettext` to the fallback.
250+
If a fallback has been set, forward :meth:`!gettext` to the fallback.
251251
Otherwise, return *message*. Overridden in derived classes.
252252

253253

254254
.. method:: ngettext(singular, plural, n)
255255

256-
If a fallback has been set, forward :meth:`ngettext` to the fallback.
256+
If a fallback has been set, forward :meth:`!ngettext` to the fallback.
257257
Otherwise, return *singular* if *n* is 1; return *plural* otherwise.
258258
Overridden in derived classes.
259259

260260

261261
.. method:: lgettext(message)
262262
.. method:: lngettext(singular, plural, n)
263263

264-
Equivalent to :meth:`.gettext` and :meth:`ngettext`, but the translation
264+
Equivalent to :meth:`.gettext` and :meth:`.ngettext`, but the translation
265265
is returned as a byte string encoded in the preferred system encoding
266266
if no encoding was explicitly set with :meth:`set_output_charset`.
267267
Overridden in derived classes.

Doc/library/locale.rst

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -551,17 +551,23 @@ library.
551551
Access to message catalogs
552552
--------------------------
553553

554+
.. function:: gettext(msg)
555+
.. function:: dgettext(domain, msg)
556+
.. function:: dcgettext(domain, msg, category)
557+
.. function:: textdomain(domain)
558+
.. function:: bindtextdomain(domain, dir)
559+
554560
The locale module exposes the C library's gettext interface on systems that
555-
provide this interface. It consists of the functions :func:`gettext`,
556-
:func:`dgettext`, :func:`dcgettext`, :func:`textdomain`, :func:`bindtextdomain`,
557-
and :func:`bind_textdomain_codeset`. These are similar to the same functions in
561+
provide this interface. It consists of the functions :func:`!gettext`,
562+
:func:`!dgettext`, :func:`!dcgettext`, :func:`!textdomain`, :func:`!bindtextdomain`,
563+
and :func:`!bind_textdomain_codeset`. These are similar to the same functions in
558564
the :mod:`gettext` module, but use the C library's binary format for message
559565
catalogs, and the C library's search algorithms for locating message catalogs.
560566

561567
Python applications should normally find no need to invoke these functions, and
562568
should use :mod:`gettext` instead. A known exception to this rule are
563569
applications that link with additional C libraries which internally invoke
564-
:c:func:`gettext` or :func:`dcgettext`. For these applications, it may be
570+
:c:func:`gettext` or :c:func:`dcgettext`. For these applications, it may be
565571
necessary to bind the text domain, so that the libraries can properly locate
566572
their message catalogs.
567573

0 commit comments

Comments
 (0)