Skip to content

Commit ef346a2

Browse files
[2.7] bpo-31667: Fix gettext related links. (GH-3860) (#4100)
* Fix incorrect links. * Remove redundant links. * Add signatures and index entries for gettext related functions in the locale module. (cherry picked from commit c02a1f4)
1 parent 5ef883b commit ef346a2

File tree

2 files changed

+18
-12
lines changed

2 files changed

+18
-12
lines changed

Doc/library/gettext.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ Class-based API
149149

150150
The class-based API of the :mod:`gettext` module gives you more flexibility and
151151
greater convenience than the GNU :program:`gettext` API. It is the recommended
152-
way of localizing your Python applications and modules. :mod:`gettext` defines
152+
way of localizing your Python applications and modules. :mod:`!gettext` defines
153153
a "translations" class which implements the parsing of GNU :file:`.mo` format
154154
files, and has methods for returning either standard 8-bit strings or Unicode
155155
strings. Instances of this "translations" class can also install themselves in
@@ -239,7 +239,7 @@ Translation classes are what actually implement the translation of original
239239
source file message strings to translated message strings. The base class used
240240
by all translation classes is :class:`NullTranslations`; this provides the basic
241241
interface you can use to write your own specialized translation classes. Here
242-
are the methods of :class:`NullTranslations`:
242+
are the methods of :class:`!NullTranslations`:
243243

244244

245245
.. class:: NullTranslations([fp])
@@ -268,14 +268,14 @@ are the methods of :class:`NullTranslations`:
268268

269269
.. method:: gettext(message)
270270

271-
If a fallback has been set, forward :meth:`gettext` to the
271+
If a fallback has been set, forward :meth:`!gettext` to the
272272
fallback. Otherwise, return the translated message. Overridden in derived
273273
classes.
274274

275275

276276
.. method:: lgettext(message)
277277

278-
If a fallback has been set, forward :meth:`lgettext` to the
278+
If a fallback has been set, forward :meth:`!lgettext` to the
279279
fallback. Otherwise, return the translated message. Overridden in derived
280280
classes.
281281

@@ -284,14 +284,14 @@ are the methods of :class:`NullTranslations`:
284284

285285
.. method:: ugettext(message)
286286

287-
If a fallback has been set, forward :meth:`ugettext` to the
287+
If a fallback has been set, forward :meth:`!ugettext` to the
288288
fallback. Otherwise, return the translated message as a Unicode
289289
string. Overridden in derived classes.
290290

291291

292292
.. method:: ngettext(singular, plural, n)
293293

294-
If a fallback has been set, forward :meth:`ngettext` to the
294+
If a fallback has been set, forward :meth:`!ngettext` to the
295295
fallback. Otherwise, return the translated message. Overridden in derived
296296
classes.
297297

@@ -300,7 +300,7 @@ are the methods of :class:`NullTranslations`:
300300

301301
.. method:: lngettext(singular, plural, n)
302302

303-
If a fallback has been set, forward :meth:`lngettext` to the
303+
If a fallback has been set, forward :meth:`!lngettext` to the
304304
fallback. Otherwise, return the translated message. Overridden in derived
305305
classes.
306306

@@ -309,7 +309,7 @@ are the methods of :class:`NullTranslations`:
309309

310310
.. method:: ungettext(singular, plural, n)
311311

312-
If a fallback has been set, forward :meth:`ungettext` to the fallback.
312+
If a fallback has been set, forward :meth:`!ungettext` to the fallback.
313313
Otherwise, return the translated message as a Unicode string. Overridden
314314
in derived classes.
315315

Doc/library/locale.rst

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

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

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

0 commit comments

Comments
 (0)