OS : Linux
PHP Version : 7.4.33
Software : Apache/2.4.6 (CentOS) PHP/7.4.33
Information System : Linux apprendre2 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
Disable Function :
The functionality Babel provides for internationalization (I18n) and
localization (L10N) can be separated into two different aspects: Contents While the Python standard library includes a
gettext module that enables
applications to use message catalogs, it requires developers to build these
catalogs using GNU tools such as xgettext, msgmerge, and msgfmt.
And while xgettext does have support for extracting messages from Python
files, it does not know how to deal with other kinds of files commonly found
in Python web-applications, such as templates, nor does it provide an easy
extensibility mechanism to add such support. Babel addresses this by providing a framework where various extraction methods
can be plugged in to a larger message extraction framework, and also removes
the dependency on the GNU gettext tools for common tasks, as these aren't
necessarily available on all platforms. See Working with Message Catalogs
for details on this aspect of Babel. Furthermore, while the Python standard library does include support for basic
localization with respect to the formatting of numbers and dates (the
locale module, among others),
this support is based on the assumption that there will be only one specific
locale used per process (at least simultaneously.) Also, it doesn't provide
access to other kinds of locale data, such as the localized names of countries,
languages, or time-zones, which are frequently needed in web-based applications. For these requirements, Babel includes data extracted from the Common Locale
Data Repository (CLDR), and provides a number of
convenient methods for accessing and using this data. See Locale Display
Names, Date Formatting, and Number Formatting for more information on
this aspect of Babel.Introduction
1 Message Catalogs
2 Locale Data