babel ~~~~~ Integrated collection of utilities that assist in internationalizing and localizing applications. This package is basically composed of two major parts: * tools to build and work with ``gettext`` message catalogs * a Python interface to the CLDR (Common Locale Data Repository), providing access to various locale display names, localized number and date formatting, etc. :copyright: (c) 2013-2023 by the Babel Team. :license: BSD, see LICENSE for more details.
Module | core |
babel.core ~~~~~~~~~~ |
Module | dates |
babel.dates ~~~~~~~~~~~ |
Module | languages |
No module docstring; 2/2 functions documented |
Module | lists |
babel.lists ~~~~~~~~~~~ |
Module | localedata |
babel.localedata ~~~~~~~~~~~~~~~~ |
Package | localtime |
babel.localtime ~~~~~~~~~~~~~~~ |
Package | messages |
babel.messages ~~~~~~~~~~~~~~ |
Module | numbers |
babel.numbers ~~~~~~~~~~~~~ |
Module | plural |
babel.numbers ~~~~~~~~~~~~~ |
Module | support |
babel.support ~~~~~~~~~~~~~ |
Module | units |
No module docstring; 5/5 functions, 0/1 exception documented |
Module | util |
babel.util ~~~~~~~~~~ |
From __init__.py
:
Function | get |
The reverse of :func:`parse_locale`. It creates a locale identifier out of a ``(language, territory, script, variant, modifier)`` tuple. Items can be set to ``None`` and trailing ``None``\s can also be left out of the tuple. |
Variable | __version__ |
Undocumented |
(((tuple[ str]|tuple[ str, str|None])|tuple[ str, str|None, str|None])|tuple[ str, str|None, str|None, str|None])|tuple[ str, str|None, str|None, str|None, str|None]
, sep: str
= '_') -> str
:
(source)
¶
The reverse of :func:`parse_locale`. It creates a locale identifier out of a ``(language, territory, script, variant, modifier)`` tuple. Items can be set to ``None`` and trailing ``None``\s can also be left out of the tuple. >>> get_locale_identifier(('de', 'DE', None, '1999', 'custom')) 'de_DE_1999@custom' >>> get_locale_identifier(('fi', None, None, None, 'custom')) 'fi@custom' .. versionadded:: 1.0 :param tup: the tuple as returned by :func:`parse_locale`. :param sep: the separator for the identifier.