module documentation

babel.messages.catalog ~~~~~~~~~~~~~~~~~~~~~~ Data structures for message catalogs. :copyright: (c) 2013-2023 by the Babel Team. :license: BSD, see LICENSE for more details.

Class Catalog Representation of a message catalog.
Class Message Representation of a single message in a catalog.
Exception TranslationError Exception thrown by translation checkers when invalid message translations are encountered.
Function get_close_matches A modified version of ``difflib.get_close_matches``.
Function parse_separated_header Undocumented
Constant DEFAULT_HEADER Undocumented
Constant PYTHON_FORMAT Undocumented
Function _parse_datetime_header Undocumented
Type Alias _MessageID Undocumented
def get_close_matches(word, possibilities, n=3, cutoff=0.6): (source)

A modified version of ``difflib.get_close_matches``. It just passes ``autojunk=False`` to the ``SequenceMatcher``, to work around https://github.com/python/cpython/issues/90825.

def parse_separated_header(value: str) -> dict[str, str]: (source)

Undocumented

DEFAULT_HEADER: str = (source)

Undocumented

Value
'''# Translations template for PROJECT.
# Copyright (C) YEAR ORGANIZATION
# This file is distributed under the same license as the PROJECT project.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#'''
PYTHON_FORMAT = (source)

Undocumented

Value
re.compile('''
    \\%
        (?:\\(([\\w]*)\\))?
        (
            [-#0\\ +]?(?:\\*|[\\d]+)?
            (?:\\.(?:\\*|[\\d]+))?
            [hlL]?
...
def _parse_datetime_header(value: str) -> datetime.datetime: (source)

Undocumented

_MessageID: TypeAlias = (source)

Undocumented

Value
(str|tuple[str, ...])|list[str]