1
.. -*- mode: rst; encoding: utf-8 -*-
7
The functionality Babel provides for internationalization (I18n) and
8
localization (L10N) can be separated into two different aspects:
10
* tools to build and work with ``gettext`` message catalogs, and
11
* a Python interface to the CLDR (Common Locale Data Repository), providing
12
access to various locale display names, localized number and date
15
.. contents:: Contents
23
While the Python standard library includes a
24
`gettext <http://docs.python.org/lib/module-gettext.html>`_ module that enables
25
applications to use message catalogs, it requires developers to build these
26
catalogs using GNU tools such as ``xgettext``, ``msgmerge``, and ``msgfmt``.
27
And while ``xgettext`` does have support for extracting messages from Python
28
files, it does not know how to deal with other kinds of files commonly found
29
in Python web-applications, such as templates, nor does it provide an easy
30
extensibility mechanism to add such support.
32
Babel addresses this by providing a framework where various extraction methods
33
can be plugged in to a larger message extraction framework, and also removes
34
the dependency on the GNU ``gettext`` tools for common tasks, as these aren't
35
necessarily available on all platforms. See `Working with Message Catalogs`_
36
for details on this aspect of Babel.
38
.. _`Working with Message Catalogs`: messages.html
44
Furthermore, while the Python standard library does include support for basic
45
localization with respect to the formatting of numbers and dates (the
46
`locale <http://docs.python.org/lib/module-locale.html>`_ module, among others),
47
this support is based on the assumption that there will be only one specific
48
locale used per process (at least simultaneously.) Also, it doesn't provide
49
access to other kinds of locale data, such as the localized names of countries,
50
languages, or time-zones, which are frequently needed in web-based applications.
52
For these requirements, Babel includes data extracted from the `Common Locale
53
Data Repository (CLDR) <http://unicode.org/cldr/>`_, and provides a number of
54
convenient methods for accessing and using this data. See `Locale Display
55
Names`_, `Date Formatting`_, and `Number Formatting`_ for more information on
59
.. _`Locale Display Names`: display.html
60
.. _`Date Formatting`: dates.html
61
.. _`Number Formatting`: numbers.html