--- rest25/library/gettext.rst	2008-12-19 16:58:07.000000000 +0900
+++ rest262/library/gettext.rst	2009-04-05 05:02:09.000000000 +0900
@@ -88,27 +88,28 @@
 
    .. versionadded:: 2.4
 
 
 .. function:: ngettext(singular, plural, n)
 
    Like :func:`gettext`, but consider plural forms. If a translation is found,
    apply the plural formula to *n*, and return the resulting message (some
    languages have more than two plural forms). If no translation is found, return
    *singular* if *n* is 1; return *plural* otherwise.
 
    The Plural formula is taken from the catalog header. It is a C or Python
-   expression that has a free variable n; the expression evaluates to the index of
-   the plural in the catalog. See the GNU gettext documentation for the precise
-   syntax to be used in .po files, and the formulas for a variety of languages.
+   expression that has a free variable *n*; the expression evaluates to the index
+   of the plural in the catalog. See the GNU gettext documentation for the precise
+   syntax to be used in :file:`.po` files and the formulas for a variety of
+   languages.
 
    .. versionadded:: 2.3
 
 
 .. function:: lngettext(singular, plural, n)
 
    Equivalent to :func:`ngettext`, but the translation is returned in the preferred
    system encoding, if no other encoding was explicitly set with
    :func:`bind_textdomain_codeset`.
 
    .. versionadded:: 2.4
 
@@ -230,173 +231,178 @@
 
 
 The :class:`NullTranslations` class
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 Translation classes are what actually implement the translation of original
 source file message strings to translated message strings. The base class used
 by all translation classes is :class:`NullTranslations`; this provides the basic
 interface you can use to write your own specialized translation classes.  Here
 are the methods of :class:`NullTranslations`:
 
 
-.. method:: NullTranslations.__init__([fp])
+.. class:: NullTranslations([fp])
 
    Takes an optional file object *fp*, which is ignored by the base class.
    Initializes "protected" instance variables *_info* and *_charset* which are set
    by derived classes, as well as *_fallback*, which is set through
    :meth:`add_fallback`.  It then calls ``self._parse(fp)`` if *fp* is not
    ``None``.
 
 
-.. method:: NullTranslations._parse(fp)
+   .. method:: _parse(fp)
 
-   No-op'd in the base class, this method takes file object *fp*, and reads the
-   data from the file, initializing its message catalog.  If you have an
-   unsupported message catalog file format, you should override this method to
-   parse your format.
+      No-op'd in the base class, this method takes file object *fp*, and reads
+      the data from the file, initializing its message catalog.  If you have an
+      unsupported message catalog file format, you should override this method
+      to parse your format.
 
 
-.. method:: NullTranslations.add_fallback(fallback)
+   .. method:: add_fallback(fallback)
 
-   Add *fallback* as the fallback object for the current translation object. A
-   translation object should consult the fallback if it cannot provide a
-   translation for a given message.
+      Add *fallback* as the fallback object for the current translation
+      object. A translation object should consult the fallback if it cannot provide a
+      translation for a given message.
 
 
-.. method:: NullTranslations.gettext(message)
+   .. method:: gettext(message)
 
-   If a fallback has been set, forward :meth:`gettext` to the fallback. Otherwise,
-   return the translated message.  Overridden in derived classes.
+      If a fallback has been set, forward :meth:`gettext` to the
+      fallback. Otherwise, return the translated message.  Overridden in derived
+      classes.
 
 
-.. method:: NullTranslations.lgettext(message)
+   .. method:: lgettext(message)
 
-   If a fallback has been set, forward :meth:`lgettext` to the fallback. Otherwise,
-   return the translated message.  Overridden in derived classes.
+      If a fallback has been set, forward :meth:`lgettext` to the
+      fallback. Otherwise, return the translated message.  Overridden in derived
+      classes.
 
-   .. versionadded:: 2.4
+      .. versionadded:: 2.4
 
 
-.. method:: NullTranslations.ugettext(message)
+   .. method:: ugettext(message)
 
-   If a fallback has been set, forward :meth:`ugettext` to the fallback. Otherwise,
-   return the translated message as a Unicode string. Overridden in derived
-   classes.
+      If a fallback has been set, forward :meth:`ugettext` to the
+      fallback. Otherwise, return the translated message as a Unicode
+      string. Overridden in derived classes.
 
 
-.. method:: NullTranslations.ngettext(singular, plural, n)
+   .. method:: ngettext(singular, plural, n)
 
-   If a fallback has been set, forward :meth:`ngettext` to the fallback. Otherwise,
-   return the translated message.  Overridden in derived classes.
+      If a fallback has been set, forward :meth:`ngettext` to the
+      fallback. Otherwise, return the translated message.  Overridden in derived
+      classes.
 
-   .. versionadded:: 2.3
+      .. versionadded:: 2.3
 
 
-.. method:: NullTranslations.lngettext(singular, plural, n)
+   .. method:: lngettext(singular, plural, n)
 
-   If a fallback has been set, forward :meth:`ngettext` to the fallback. Otherwise,
-   return the translated message.  Overridden in derived classes.
+      If a fallback has been set, forward :meth:`ngettext` to the
+      fallback. Otherwise, return the translated message.  Overridden in derived
+      classes.
 
-   .. versionadded:: 2.4
+      .. versionadded:: 2.4
 
 
-.. method:: NullTranslations.ungettext(singular, plural, n)
+   .. method:: ungettext(singular, plural, n)
 
-   If a fallback has been set, forward :meth:`ungettext` to the fallback.
-   Otherwise, return the translated message as a Unicode string. Overridden in
-   derived classes.
+      If a fallback has been set, forward :meth:`ungettext` to the fallback.
+      Otherwise, return the translated message as a Unicode string. Overridden
+      in derived classes.
 
-   .. versionadded:: 2.3
+      .. versionadded:: 2.3
 
 
-.. method:: NullTranslations.info()
+   .. method:: info()
 
-   Return the "protected" :attr:`_info` variable.
+      Return the "protected" :attr:`_info` variable.
 
 
-.. method:: NullTranslations.charset()
+   .. method:: charset()
 
-   Return the "protected" :attr:`_charset` variable.
+      Return the "protected" :attr:`_charset` variable.
 
 
-.. method:: NullTranslations.output_charset()
+   .. method:: output_charset()
 
-   Return the "protected" :attr:`_output_charset` variable, which defines the
-   encoding used to return translated messages.
+      Return the "protected" :attr:`_output_charset` variable, which defines the
+      encoding used to return translated messages.
 
-   .. versionadded:: 2.4
+      .. versionadded:: 2.4
 
 
-.. method:: NullTranslations.set_output_charset(charset)
+   .. method:: set_output_charset(charset)
 
-   Change the "protected" :attr:`_output_charset` variable, which defines the
-   encoding used to return translated messages.
+      Change the "protected" :attr:`_output_charset` variable, which defines the
+      encoding used to return translated messages.
 
-   .. versionadded:: 2.4
+      .. versionadded:: 2.4
 
 
-.. method:: NullTranslations.install([unicode [, names]])
+   .. method:: install([unicode [, names]])
 
-   If the *unicode* flag is false, this method installs :meth:`self.gettext` into
-   the built-in namespace, binding it to ``_``.  If *unicode* is true, it binds
-   :meth:`self.ugettext` instead.  By default, *unicode* is false.
-
-   If the *names* parameter is given, it must be a sequence containing the names of
-   functions you want to install in the builtin namespace in addition to :func:`_`.
-   Supported names are ``'gettext'`` (bound to :meth:`self.gettext` or
-   :meth:`self.ugettext` according to the *unicode* flag), ``'ngettext'`` (bound to
-   :meth:`self.ngettext` or :meth:`self.ungettext` according to the *unicode*
-   flag), ``'lgettext'`` and ``'lngettext'``.
-
-   Note that this is only one way, albeit the most convenient way, to make the
-   :func:`_` function available to your application.  Because it affects the entire
-   application globally, and specifically the built-in namespace, localized modules
-   should never install :func:`_`. Instead, they should use this code to make
-   :func:`_` available to their module::
-
-      import gettext
-      t = gettext.translation('mymodule', ...)
-      _ = t.gettext
+      If the *unicode* flag is false, this method installs :meth:`self.gettext`
+      into the built-in namespace, binding it to ``_``.  If *unicode* is true,
+      it binds :meth:`self.ugettext` instead.  By default, *unicode* is false.
 
-   This puts :func:`_` only in the module's global namespace and so only affects
-   calls within this module.
+      If the *names* parameter is given, it must be a sequence containing the
+      names of functions you want to install in the builtin namespace in
+      addition to :func:`_`.  Supported names are ``'gettext'`` (bound to
+      :meth:`self.gettext` or :meth:`self.ugettext` according to the *unicode*
+      flag), ``'ngettext'`` (bound to :meth:`self.ngettext` or
+      :meth:`self.ungettext` according to the *unicode* flag), ``'lgettext'``
+      and ``'lngettext'``.
 
-   .. versionchanged:: 2.5
-      Added the *names* parameter.
+      Note that this is only one way, albeit the most convenient way, to make
+      the :func:`_` function available to your application.  Because it affects
+      the entire application globally, and specifically the built-in namespace,
+      localized modules should never install :func:`_`. Instead, they should use
+      this code to make :func:`_` available to their module::
+
+         import gettext
+         t = gettext.translation('mymodule', ...)
+         _ = t.gettext
+
+      This puts :func:`_` only in the module's global namespace and so only
+      affects calls within this module.
+
+      .. versionchanged:: 2.5
+         Added the *names* parameter.
 
 
 The :class:`GNUTranslations` class
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 The :mod:`gettext` module provides one additional class derived from
 :class:`NullTranslations`: :class:`GNUTranslations`.  This class overrides
 :meth:`_parse` to enable reading GNU :program:`gettext` format :file:`.mo` files
 in both big-endian and little-endian format. It also coerces both message ids
 and message strings to Unicode.
 
 :class:`GNUTranslations` parses optional meta-data out of the translation
 catalog.  It is convention with GNU :program:`gettext` to include meta-data as
 the translation for the empty string.  This meta-data is in :rfc:`822`\ -style
 ``key: value`` pairs, and should contain the ``Project-Id-Version`` key.  If the
 key ``Content-Type`` is found, then the ``charset`` property is used to
 initialize the "protected" :attr:`_charset` instance variable, defaulting to
 ``None`` if not found.  If the charset encoding is specified, then all message
 ids and message strings read from the catalog are converted to Unicode using
 this encoding.  The :meth:`ugettext` method always returns a Unicode, while the
 :meth:`gettext` returns an encoded 8-bit string.  For the message id arguments
-of both methods, either Unicode strings or 8-bit strings containing only US-
-ASCII characters are acceptable.  Note that the Unicode version of the methods
-(i.e. :meth:`ugettext` and :meth:`ungettext`) are the recommended interface to
-use for internationalized Python programs.
+of both methods, either Unicode strings or 8-bit strings containing only
+US-ASCII characters are acceptable.  Note that the Unicode version of the
+methods (i.e. :meth:`ugettext` and :meth:`ungettext`) are the recommended
+interface to use for internationalized Python programs.
 
 The entire set of key/value pairs are placed into a dictionary and set as the
 "protected" :attr:`_info` instance variable.
 
 If the :file:`.mo` file's magic number is invalid, or if other problems occur
 while reading the file, instantiating a :class:`GNUTranslations` class can raise
 :exc:`IOError`.
 
 The following methods are overridden from the base class implementation:
 
 
 .. method:: GNUTranslations.gettext(message)
@@ -633,72 +639,69 @@
    lang3.install()
 
 
 Deferred translations
 ^^^^^^^^^^^^^^^^^^^^^
 
 In most coding situations, strings are translated where they are coded.
 Occasionally however, you need to mark strings for translation, but defer actual
 translation until later.  A classic example is::
 
    animals = ['mollusk',
               'albatross',
-   	   'rat',
-   	   'penguin',
-   	   'python',
-   	   ]
+              'rat',
+              'penguin',
+              'python', ]
    # ...
    for a in animals:
        print a
 
 Here, you want to mark the strings in the ``animals`` list as being
 translatable, but you don't actually want to translate them until they are
 printed.
 
 Here is one way you can handle this situation::
 
    def _(message): return message
 
    animals = [_('mollusk'),
               _('albatross'),
-   	   _('rat'),
-   	   _('penguin'),
-   	   _('python'),
-   	   ]
+              _('rat'),
+              _('penguin'),
+              _('python'), ]
 
    del _
 
    # ...
    for a in animals:
        print _(a)
 
 This works because the dummy definition of :func:`_` simply returns the string
 unchanged.  And this dummy definition will temporarily override any definition
 of :func:`_` in the built-in namespace (until the :keyword:`del` command). Take
 care, though if you have a previous definition of :func:`_` in the local
 namespace.
 
 Note that the second use of :func:`_` will not identify "a" as being
 translatable to the :program:`pygettext` program, since it is not a string.
 
 Another way to handle this is with the following example::
 
    def N_(message): return message
 
    animals = [N_('mollusk'),
               N_('albatross'),
-   	   N_('rat'),
-   	   N_('penguin'),
-   	   N_('python'),
-   	   ]
+              N_('rat'),
+              N_('penguin'),
+              N_('python'), ]
 
    # ...
    for a in animals:
        print _(a)
 
 In this case, you are marking translatable strings with the function :func:`N_`,
 [#]_ which won't conflict with any definition of :func:`_`.  However, you will
 need to teach your message extraction program to look for translatable strings
 marked with :func:`N_`. :program:`pygettext` and :program:`xpot` both support
 this through the use of command line switches.
 
 
@@ -742,23 +745,23 @@
 .. rubric:: Footnotes
 
 .. [#] The default locale directory is system dependent; for example, on RedHat Linux
    it is :file:`/usr/share/locale`, but on Solaris it is :file:`/usr/lib/locale`.
    The :mod:`gettext` module does not try to support these system dependent
    defaults; instead its default is :file:`sys.prefix/share/locale`. For this
    reason, it is always best to call :func:`bindtextdomain` with an explicit
    absolute path at the start of your application.
 
 .. [#] See the footnote for :func:`bindtextdomain` above.
 
 .. [#] François Pinard has written a program called :program:`xpot` which does a
-   similar job.  It is available as part of his :program:`po-utils` package at
-   `<http://po-utils.progiciels-bpi.ca/>`_.
+   similar job.  It is available as part of his :program:`po-utils` package at http
+   ://po-utils.progiciels-bpi.ca/.
 
 .. [#] :program:`msgfmt.py` is binary compatible with GNU :program:`msgfmt` except that
    it provides a simpler, all-Python implementation.  With this and
    :program:`pygettext.py`, you generally won't need to install the GNU
    :program:`gettext` package to internationalize your Python applications.
 
 .. [#] The choice of :func:`N_` here is totally arbitrary; it could have just as easily
    been :func:`MarkThisStringForTranslation`.
 
