Lines Matching full:gettext

1 :mod:`gettext` --- Multilingual internationalization services
4 .. module:: gettext
10 **Source code:** :source:`Lib/gettext.py`
14 The :mod:`gettext` module provides internationalization (I18N) and localization
16 GNU ``gettext`` message catalog API and a higher level, class-based API that may
25 GNU :program:`gettext` API
28 The :mod:`gettext` module defines the following API, which is very similar to
29 the GNU :program:`gettext` API. If you use this API you will affect the
40 :mod:`gettext` will look for binary :file:`.mo` files for the given domain using
64 .. index:: single: _ (underscore); gettext
65 .. function:: gettext(message)
74 Like :func:`.gettext`, but look the message up in the specified *domain*.
79 Like :func:`.gettext`, but consider plural forms. If a translation is found,
87 `the GNU gettext documentation <https://www.gnu.org/software/gettext/manual/gettext.html>`__
103 (:func:`.gettext`, :func:`dgettext`, :func:`ngettext` and :func:`dngettext`),
120 Note that GNU :program:`gettext` also defines a :func:`dcgettext` method, but
125 import gettext
126 gettext.bindtextdomain('myapplication', '/path/to/my/language/directory')
127 gettext.textdomain('myapplication')
128 _ = gettext.gettext
136 The class-based API of the :mod:`gettext` module gives you more flexibility and
137 greater convenience than the GNU :program:`gettext` API. It is the recommended
138 way of localizing your Python applications and modules. :mod:`!gettext` defines
249 .. method:: gettext(message)
251 If a fallback has been set, forward :meth:`!gettext` to the fallback.
265 Equivalent to :meth:`.gettext` and :meth:`.ngettext`, but the translation
299 This method installs :meth:`.gettext` into the built-in namespace,
304 addition to :func:`_`. Supported names are ``'gettext'``, ``'ngettext'``,
313 import gettext
314 t = gettext.translation('mymodule', ...)
315 _ = t.gettext
324 The :mod:`gettext` module provides one additional class derived from
326 :meth:`_parse` to enable reading GNU :program:`gettext` format :file:`.mo` files
330 catalog. It is convention with GNU :program:`gettext` to include meta-data as
339 Since message ids are read as Unicode strings too, all :meth:`*gettext` methods
353 .. method:: gettext(message)
358 fallback's :meth:`~NullTranslations.gettext` method. Otherwise, the
386 Equivalent to :meth:`.gettext` and :meth:`.ngettext`, but the translation
410 GNOME uses a version of the :mod:`gettext` module by James Henstridge, but this
413 import gettext
414 cat = gettext.Catalog(domain, localedir)
415 _ = cat.gettext
441 #. use the :mod:`gettext` module so that message strings are properly translated
457 The original GNU :program:`gettext` only supported C or C++ source
475 :program:`gettext` package to internationalize your Python
490 :mod:`gettext` module for the actual translation processing at
493 How you use the :mod:`gettext` module in your code depends on whether you are
502 changes, e.g. to the built-in namespace. You should not use the GNU ``gettext``
507 :program:`gettext` format. Here's what you would put at the top of your
510 import gettext
511 t = gettext.translation('spam', '/usr/share/locale')
512 _ = t.gettext
526 import gettext
527 gettext.install('myapplication')
532 import gettext
533 gettext.install('myapplication', '/usr/share/locale')
543 import gettext
545 lang1 = gettext.translation('myapplication', languages=['en'])
546 lang2 = gettext.translation('myapplication', languages=['fr'])
547 lang3 = gettext.translation('myapplication', languages=['de'])
602 translatable to the :program:`gettext` program, because the parameter
655 The :mod:`gettext` module does not try to support these system dependent