Your IP : 3.145.43.200


Current Path : /opt/imunify360/venv/lib64/python3.11/site-packages/babel/__pycache__/
Upload File :
Current File : //opt/imunify360/venv/lib64/python3.11/site-packages/babel/__pycache__/support.cpython-311.pyc

�

Q�Dgf��8�dZddlmZddlZddlZddlZddlZddlmZddl	m
Z
mZmZddl
mZddlmZmZmZmZddlmZmZmZmZmZmZe
rdd	lmZdd
lmZGd�d��ZGd
�d��ZGd�dej ��Z Gd�de ej!��Z"dS)a-
    babel.support
    ~~~~~~~~~~~~~

    Several classes and functions that help with integrating and using Babel
    in applications.

    .. note: the code in this module is not used by Babel itself

    :copyright: (c) 2013-2023 by the Babel Team.
    :license: BSD, see LICENSE for more details.
�)�annotationsN)�Iterator)�
TYPE_CHECKING�Any�Callable)�Locale)�format_date�format_datetime�format_time�format_timedelta)�format_compact_currency�format_compact_decimal�format_currency�format_decimal�format_percent�format_scientific)�Literal)�_PredefinedTimeFormatc��eZdZdZd6d7d	�Z		d8d9d�Z		d8d:d�Z		d8d;d�Z				d<d=d#�Zd>d&�Z	d6d?d(�Z
		d@dAd/�ZdBd1�Z		d@dCd3�Z
d6d?d4�Zd>d5�ZdS)D�FormataCWrapper class providing the various date and number formatting functions
    bound to a specific locale and time-zone.

    >>> from babel.util import UTC
    >>> from datetime import date
    >>> fmt = Format('en_US', UTC)
    >>> fmt.date(date(2007, 4, 1))
    u'Apr 1, 2007'
    >>> fmt.decimal(1.2345)
    u'1.234'
    N�locale�Locale | str�tzinfo�datetime.tzinfo | None�return�Nonec�F�tj|��|_||_dS)z�Initialize the formatter.

        :param locale: the locale identifier or `Locale` instance
        :param tzinfo: the time-zone info (a `tzinfo` instance or `None`)
        N)r�parserr)�selfrrs   �m/builddir/build/BUILD/imunify360-venv-2.4.0/opt/imunify360/venv/lib/python3.11/site-packages/babel/support.py�__init__zFormat.__init__4s ���l�6�*�*���������medium�date�datetime.date | None�format�_PredefinedTimeFormat | str�strc�0�t|||j���S)z�Return a date formatted according to the given pattern.

        >>> from datetime import date
        >>> fmt = Format('en_US')
        >>> fmt.date(date(2007, 4, 1))
        u'Apr 1, 2007'
        �r)r	r)rr$r&s   r r$zFormat.date=s���4����<�<�<�<r"�datetimec�<�t|||j|j���S)uGReturn a date and time formatted according to the given pattern.

        >>> from datetime import datetime
        >>> from babel.dates import get_timezone
        >>> fmt = Format('en_US', tzinfo=get_timezone('US/Eastern'))
        >>> fmt.datetime(datetime(2007, 4, 1, 15, 30))
        u'Apr 1, 2007, 11:30:00 AM'
        �rr)r
rr)rr+r&s   r r+zFormat.datetimeKs���x����D�K�X�X�X�Xr"�time�(datetime.time | datetime.datetime | Nonec�<�t|||j|j���S)u-Return a time formatted according to the given pattern.

        >>> from datetime import datetime
        >>> from babel.dates import get_timezone
        >>> fmt = Format('en_US', tzinfo=get_timezone('US/Eastern'))
        >>> fmt.time(datetime(2007, 4, 1, 15, 30))
        u'11:30:00 AM'
        r-)rrr)rr.r&s   r r.zFormat.timeZs���4����D�K�P�P�P�Pr"�second�333333�?�longF�delta�datetime.timedelta | int�granularity�CLiteral['year', 'month', 'week', 'day', 'hour', 'minute', 'second']�	threshold�float�,Literal['narrow', 'short', 'medium', 'long']�
add_direction�boolc�6�t||||||j���S)z�Return a time delta according to the rules of the given locale.

        >>> from datetime import timedelta
        >>> fmt = Format('en_US')
        >>> fmt.timedelta(timedelta(weeks=11))
        u'3 months'
        )r6r8r&r;r)rr)rr4r6r8r&r;s      r �	timedeltazFormat.timedeltais,�� ��;�*3�'-�]�'+�{�4�4�4�	4r"�number�float | decimal.Decimal | strc�.�t||j���S)z�Return an integer number formatted for the locale.

        >>> fmt = Format('en_US')
        >>> fmt.number(1099)
        u'1,099'
        r*�rr�rr?s  r r?z
Format.number}s���f�T�[�9�9�9�9r"�
str | Nonec�0�t|||j���S)z�Return a decimal number formatted for the locale.

        >>> fmt = Format('en_US')
        >>> fmt.decimal(1.2345)
        u'1.234'
        r*rB�rr?r&s   r �decimalzFormat.decimal�����f�f�T�[�A�A�A�Ar"�shortr�format_type�Literal['short', 'long']�fraction_digits�intc�2�t||||j���S)aReturn a number formatted in compact form for the locale.

        >>> fmt = Format('en_US')
        >>> fmt.compact_decimal(123456789)
        u'123M'
        >>> fmt.compact_decimal(1234567, format_type='long', fraction_digits=2)
        '1.23 million'
        �rJrLr)rr)rr?rJrLs    r �compact_decimalzFormat.compact_decimal�s'��&�f�+�6E�-1�[�:�:�:�	:r"�currencyc�0�t|||j���S)zHReturn a number in the given currency formatted for the locale.
        r*)rr)rr?rQs   r rQzFormat.currency�s���v�x���D�D�D�Dr"�Literal['short']c�4�t|||||j���S)z�Return a number in the given currency formatted for the locale
        using the compact number format.

        >>> Format('en_US').compact_currency(1234567, "USD", format_type='short', fraction_digits=2)
        '$1.23M'
        rO)r
r)rr?rQrJrLs     r �compact_currencyzFormat.compact_currency�s.��'�v�x�[�8G�PT�P[�]�]�]�	]r"c�0�t|||j���S)z�Return a number formatted as percentage for the locale.

        >>> fmt = Format('en_US')
        >>> fmt.percent(0.34)
        u'34%'
        r*)rrrFs   r �percentzFormat.percent�rHr"c�.�t||j���S)zLReturn a number formatted using scientific notation for the locale.
        r*)rrrCs  r �
scientificzFormat.scientific�s��!����<�<�<�<r"�N)rrrrrr)Nr#)r$r%r&r'rr()r+r%r&r'rr()r.r/r&r'rr()r1r2r3F)r4r5r6r7r8r9r&r:r;r<rr()r?r@rr()r?r@r&rDrr()rIr)r?r@rJrKrLrMrr()r?r@rQr(rr()
r?r@rQr(rJrSrLrMrr()�__name__�
__module__�__qualname__�__doc__r!r$r+r.r>r?rGrPrQrUrWrY�r"r rr's�������
�
������&*�.6�=�=�=�=�=� *.�.6�
Y�
Y�
Y�
Y�
Y�":>�.6�
Q�
Q�
Q�
Q�
Q�$\d��?E�#�
4�4�4�4�4�(:�:�:�:�B�B�B�B�B�18� �	:�:�:�:�:�$E�E�E�E�)0� �]�]�]�]�]� B�B�B�B�B�=�=�=�=�=�=r"rc�Z�eZdZUdZgd�Zerded<ded<ded<d	ed
<ded<d
ed<dd�d?d�Zed@d���Z	dAd�Z
dBd�ZdCd�ZdDd �Z
dEd"�ZdFd$�ZdGd&�ZdGd'�ZdGd(�ZdGd)�ZdGd*�ZdGd+�ZdHd,�ZdId-�ZdId.�ZdId/�ZdId0�ZdId1�ZdId2�ZdJd4�ZdKd5�ZdLd7�ZdMd8�Z dNd9�Z!dOd:�Z"dPd;�Z#dQd=�Z$d>S)R�	LazyProxya�Class for proxy objects that delegate to a specified function to evaluate
    the actual object.

    >>> def greeting(name='world'):
    ...     return 'Hello, %s!' % name
    >>> lazy_greeting = LazyProxy(greeting, name='Joe')
    >>> print(lazy_greeting)
    Hello, Joe!
    >>> u'  ' + lazy_greeting
    u'  Hello, Joe!'
    >>> u'(%s)' % lazy_greeting
    u'(Hello, Joe!)'

    This can be used, for example, to implement lazy translation functions that
    delay the actual translation until the string is actually used. The
    rationale for such behavior is that the locale of the user may not always
    be available. In web applications, you only know the locale when processing
    a request.

    The proxy implementation attempts to be as complete as possible, so that
    the lazy objects should mostly work as expected, for example for sorting:

    >>> greetings = [
    ...     LazyProxy(greeting, 'world'),
    ...     LazyProxy(greeting, 'Joe'),
    ...     LazyProxy(greeting, 'universe'),
    ... ]
    >>> greetings.sort()
    >>> for greeting in greetings:
    ...     print(greeting)
    Hello, Joe!
    Hello, universe!
    Hello, world!
    )�_func�_args�_kwargs�_value�_is_cache_enabled�_attribute_error�Callable[..., Any]rbztuple[Any, ...]rczdict[str, Any]rdr<rfrrezAttributeError | NonergT)�enable_cache�func�argsri�kwargsrrc�V�t�|d|��t�|d|��t�|d|��t�|d|��t�|dd��t�|dd��dS)Nrbrcrdrfrerg)�object�__setattr__)rrjrirkrls     r r!zLazyProxy.__init__�s������4��$�/�/�/����4��$�/�/�/����4��F�3�3�3����4�!4�l�C�C�C����4��4�0�0�0����4�!3�T�:�:�:�:�:r"c��|j�m	|j|ji|j��}n/#t$r"}t
�|d|���d}~wwxYw|js|St
�|d|��|jS)Nrgre)rerbrcrd�AttributeErrorrnrorf)r�value�errors   r rrzLazyProxy.value�s����;��
�"��
�D�J�?�$�,�?�?����!�
�
�
��"�"�4�);�U�C�C�C������
�����)�
������t�X�u�5�5�5��{�s�!�
A
�A�A
�keyrnc��||jvSrZ�rr�rrts  r �__contains__zLazyProxy.__contains__	s���d�j� � r"c�*�t|j��SrZ)r<rr�rs r �__bool__zLazyProxy.__bool__����D�J���r"�	list[str]c�*�t|j��SrZ)�dirrrrzs r �__dir__zLazyProxy.__dir__����4�:���r"�
Iterator[Any]c�*�t|j��SrZ)�iterrrrzs r �__iter__zLazyProxy.__iter__r|r"rMc�*�t|j��SrZ)�lenrrrzs r �__len__zLazyProxy.__len__r�r"r(c�*�t|j��SrZ)r(rrrzs r �__str__zLazyProxy.__str__r�r"�otherc��|j|zSrZrv�rr�s  r �__add__zLazyProxy.__add__����z�E�!�!r"c��||jzSrZrvr�s  r �__radd__zLazyProxy.__radd__����t�z�!�!r"c��|j|zSrZrvr�s  r �__mod__zLazyProxy.__mod__!r�r"c��||jzSrZrvr�s  r �__rmod__zLazyProxy.__rmod__$r�r"c��|j|zSrZrvr�s  r �__mul__zLazyProxy.__mul__'r�r"c��||jzSrZrvr�s  r �__rmul__zLazyProxy.__rmul__*r�r"c��|j|i|��SrZrv)rrkrls   r �__call__zLazyProxy.__call__-s���t�z�4�*�6�*�*�*r"c��|j|kSrZrvr�s  r �__lt__zLazyProxy.__lt__0����z�E�!�!r"c��|j|kSrZrvr�s  r �__le__zLazyProxy.__le__3����z�U�"�"r"c��|j|kSrZrvr�s  r �__eq__zLazyProxy.__eq__6r�r"c��|j|kSrZrvr�s  r �__ne__zLazyProxy.__ne__9r�r"c��|j|kSrZrvr�s  r �__gt__zLazyProxy.__gt__<r�r"c��|j|kSrZrvr�s  r �__ge__zLazyProxy.__ge__?r�r"�namec�0�t|j|��dSrZ)�delattrrr�rr�s  r �__delattr__zLazyProxy.__delattr__Bs����
�D�!�!�!�!�!r"c�H�|j�|j�t|j|��SrZ)rg�getattrrrr�s  r �__getattr__zLazyProxy.__getattr__Es&��� �,��'�'��t�z�4�(�(�(r"rrc�2�t|j||��dSrZ)�setattrrr)rr�rrs   r rozLazyProxy.__setattr__Js����
�D�%�(�(�(�(�(r"c��|j|=dSrZrvrws  r �__delitem__zLazyProxy.__delitem__Ms���J�s�O�O�Or"c��|j|SrZrvrws  r �__getitem__zLazyProxy.__getitem__Ps���z�#��r"c��||j|<dSrZrv)rrtrrs   r �__setitem__zLazyProxy.__setitem__Ss����
�3���r"c�N�t|jg|j�Rd|ji|j��S)Nri)rarbrcrfrdrzs r �__copy__zLazyProxy.__copy__VsF����J�
��Z�
�
�
��/�
��l�	
�
�	
r"�memoc��ddlm}t||j|��g||j|���Rd||j|��i||j|����S)Nr)�deepcopyri)�copyr�rarbrcrfrd)rr�r�s   r �__deepcopy__zLazyProxy.__deepcopy__^s���!�!�!�!�!�!���H�T�Z��&�&�
��X�d�j�$�
'�
'�
�
�
�!��$�"8�$�?�?�
��h�t�|�T�*�*�	
�
�	
r"N)
rjrhrkrrir<rlrrr)rr)rtrnrr<)rr<)rr})rr�)rrM�rr()r�rnrr)rkrrlrrr)r�rnrr<)r�r(rr)r�r(rr)r�r(rrrrr)rtrrr)rtrrr)rtrrrrrr)rra)r�rrra)%r[r\r]r^�	__slots__r�__annotations__r!�propertyrrrxr{r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�ror�r�r�r�r�r_r"r rara�s��������!�!�Da�`�`�I��0�!�!�!�!�����������������/�/�/�/�RV�;�;�;�;�;�;������X��!�!�!�!� � � � ����� � � � ���������"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�+�+�+�+�"�"�"�"�#�#�#�#�#�#�#�#�#�#�#�#�"�"�"�"�#�#�#�#�"�"�"�"�)�)�)�)�
)�)�)�)��������� � � � �
�
�
�
�
�
�
�
�
�
r"rac���eZdZUer
ded<ded<dZd)d*�fd
�
Zd+d�Zd+d�Zd+d�Z	e	Z
d,d�Zd,d�Zd,d�Z
e
ZdZd-d�Zd.d�Zd/d�Zd0d �Zd1d!�Zd/d"�Zd2d#�Zd3d$�ZeZd4d%�Zd5d&�Zd5d'�ZeZd6d(�ZejjZ ejj!Z"�xZ#S)7�NullTranslationszdict[str, str]�_infozNullTranslations | None�	_fallbackN�fp�"gettext._TranslationsReader | Nonerrc
����i|_d�|_t���|���t	tdt
|dd��g����|_|j|_	i|_
dS)aInitialize a simple translations class which is not backed by a
        real catalog. Behaves similar to gettext.NullTranslations but also
        offers Babel's on *gettext methods (e.g. 'dgettext()').

        :param fp: a file-like object (ignored in this class)
        c�(�t|dk��S)N�)rM)�ns r �<lambda>z+NullTranslations.__init__.<locals>.<lambda>{s��#�a�ST�f�+�+�r"�r�Nr�)�_catalog�plural�superr!�list�filterr��files�DEFAULT_DOMAIN�domain�_domains)rr��	__class__s  �r r!zNullTranslations.__init__psn���;=��
�@U�@U���
�����B������&����F�D�(A�(A�'B�C�C�D�D��
��)���57��
�
�
r"r�r(�messagec�^�|j�||���|��S)zULike ``gettext()``, but look the message up in the specified
        domain.
        )r��get�gettext�rr�r�s   r �dgettextzNullTranslations.dgettext�s*���}� � ���.�.�6�6�w�?�?�?r"c��ddl}|�dtd��|j�||���|��S)zVLike ``lgettext()``, but look the message up in the specified
        domain.
        rNz1ldgettext() is deprecated, use dgettext() instead�)�warnings�warn�DeprecationWarningr�r��lgettext)rr�r�r�s    r �	ldgettextzNullTranslations.ldgettext�sQ��	�����
�
�I�(�!�	-�	-�	-��}� � ���.�.�7�7��@�@�@r"c�^�|j�||���|��S)zVLike ``ugettext()``, but look the message up in the specified
        domain.
        )r�r��ugettextr�s   r �	udgettextzNullTranslations.udgettext�s*���}� � ���.�.�7�7��@�@�@r"�singularr��numrMc�b�|j�||���|||��S)zVLike ``ngettext()``, but look the message up in the specified
        domain.
        )r�r��ngettext�rr�r�r�r�s     r �	dngettextzNullTranslations.dngettext�s.���}� � ���.�.�7�7��&�#�N�N�Nr"c��ddl}|�dtd��|j�||���|||��S)zWLike ``lngettext()``, but look the message up in the specified
        domain.
        rNz3ldngettext() is deprecated, use dngettext() insteadr�)r�r�r�r�r��	lngettext)rr�r�r�r�r�s      r �
ldngettextzNullTranslations.ldngettext�sU��	�����
�
�K�(�!�	-�	-�	-��}� � ���.�.�8�8��6�3�O�O�Or"c�b�|j�||���|||��S)zVLike ``ungettext()`` but look the message up in the specified
        domain.
        )r�r��	ungettextr�s     r �
udngettextzNullTranslations.udngettext�s.���}� � ���.�.�8�8��6�3�O�O�Or"z%s%s�context�str | objectc��|j||fz}t��}|j�||��}||ur$|jr|j�||��S|S|S)a�Look up the `context` and `message` id in the catalog and return the
        corresponding message string, as an 8-bit string encoded with the
        catalog's charset encoding, if known.  If there is no entry in the
        catalog for the `message` id and `context` , and a fallback has been
        set, the look up is forwarded to the fallback's ``pgettext()``
        method. Otherwise, the `message` id is returned.
        )�CONTEXT_ENCODINGrnr�r�r��pgettext)rr�r��ctxt_msg_id�missing�tmsgs      r r�zNullTranslations.pgettext�sl���+�w��.@�@���(�(���}� � ��g�6�6���7�?�?��~�
A��~�.�.�w��@�@�@��N��r"�str | bytes | objectc��ddl}|�dtd��|�||��}t	|dd��ptj��}t|t��r|�	|��n|S)z�Equivalent to ``pgettext()``, but the translation is returned in the
        preferred system encoding, if no other encoding was explicitly set with
        ``bind_textdomain_codeset()``.
        rNz1lpgettext() is deprecated, use pgettext() insteadr��_output_charset)
r�r�r�r�r�r�getpreferredencoding�
isinstancer(�encode)rr�r�r�r��encodings      r �	lpgettextzNullTranslations.lpgettext�s���
	�����
�
�I�(�!�	-�	-�	-��}�}�W�g�.�.���4�!2�D�9�9�Z�V�=X�=Z�=Z��(2�4��(=�(=�G�t�{�{�8�$�$�$�4�Gr"c���|j||fz}	|j||�|��f}|S#t$r5|jr|j�||||��cYS|dkr|cYS|cYSwxYw)a^Do a plural-forms lookup of a message id.  `singular` is used as the
        message id for purposes of lookup in the catalog, while `num` is used to
        determine which plural form to use.  The returned message string is an
        8-bit string encoded with the catalog's charset encoding, if known.

        If the message id for `context` is not found in the catalog, and a
        fallback is specified, the request is forwarded to the fallback's
        ``npgettext()`` method.  Otherwise, when ``num`` is 1 ``singular`` is
        returned, and ``plural`` is returned in all other cases.
        r�)r�r�r��KeyErrorr��	npgettext)rr�r�r�r�r�r�s       r r
zNullTranslations.npgettext�s����+�w��.A�A��		��=�+�t�{�{�3�/?�/?�!@�A�D��K���	�	�	��~�
P��~�/�/���6�3�O�O�O�O�O��a�x�x������
�
�
�
	���s�#2�.A1�"A1�,A1�0A1�str | bytesc��ddl}|�dtd��|j||fz}	|j||�|��f}t
|dd��ptj��}|�	|��S#t$r5|jr|j�||||��cYS|dkr|cYS|cYSwxYw)z�Equivalent to ``npgettext()``, but the translation is returned in the
        preferred system encoding, if no other encoding was explicitly set with
        ``bind_textdomain_codeset()``.
        rNz3lnpgettext() is deprecated, use npgettext() insteadr�rr�)
r�r�r�r�r�r�r�rrrr	r��
lnpgettext)	rr�r�r�r�r�r�r�rs	         r r
zNullTranslations.lnpgettext�s���
	�����
�
�K�(�!�	-�	-�	-��+�w��.A�A��
	��=�+�t�{�{�3�/?�/?�!@�A�D��t�%6��=�=�^��A\�A^�A^�H��;�;�x�(�(�(���	�	�	��~�
Q��~�0�0��(�F�C�P�P�P�P�P��a�x�x������
�
�
�
	���s�AB	�	.C�9C�C�Cc��|j||fz}t��}|j�||��}||ur1|jr|j�||��St
|��St|t��sJ�|S)asLook up the `context` and `message` id in the catalog and return the
        corresponding message string, as a Unicode string.  If there is no entry
        in the catalog for the `message` id and `context`, and a fallback has
        been set, the look up is forwarded to the fallback's ``upgettext()``
        method.  Otherwise, the `message` id is returned.
        )r�rnr�r�r��	upgettextr(r)rr�r��ctxt_message_idr�r�s      r rzNullTranslations.upgettext�s����/�7�G�2D�D���(�(���}� � ��'�:�:���7�?�?��~�
B��~�/�/���A�A�A��w�<�<���$��$�$�$�$�$��r"c��|j||fz}	|j||�|��f}nZ#t$rM|jr|j�||||��cYS|dkrt
|��nt
|��}YnwxYw|S)a$Do a plural-forms lookup of a message id.  `singular` is used as the
        message id for purposes of lookup in the catalog, while `num` is used to
        determine which plural form to use.  The returned message string is a
        Unicode string.

        If the message id for `context` is not found in the catalog, and a
        fallback is specified, the request is forwarded to the fallback's
        ``unpgettext()`` method.  Otherwise, when `num` is 1 `singular` is
        returned, and `plural` is returned in all other cases.
        r�)r�r�r�r	r��
unpgettextr()rr�r�r�r�rr�s       r rzNullTranslations.unpgettexts����/�7�H�2E�E��	>��=�/�4�;�;�s�3C�3C�!D�E�D�D���	>�	>�	>��~�
Q��~�0�0��(�F�C�P�P�P�P�P�$'�1�H�H�3�x�=�=�=�#�f�+�+�D�D�D�	>�����s�"1�.B�!$B�Bc�`�|j�||���||��S)zVLike `pgettext()`, but look the message up in the specified
        `domain`.
        )r�r�r��rr�r�r�s    r �	dpgettextzNullTranslations.dpgettext$s,���}� � ���.�.�7�7���I�I�Ir"c�`�|j�||���||��S)zWLike `upgettext()`, but look the message up in the specified
        `domain`.
        )r�r�rrs    r �
udpgettextzNullTranslations.udpgettext*s,���}� � ���.�.�8�8��'�J�J�Jr"c�`�|j�||���||��S)z�Equivalent to ``dpgettext()``, but the translation is returned in the
        preferred system encoding, if no other encoding was explicitly set with
        ``bind_textdomain_codeset()``.
        )r�r�rrs    r �
ldpgettextzNullTranslations.ldpgettext2s,��
�}� � ���.�.�8�8��'�J�J�Jr"c�d�|j�||���||||��S)zWLike ``npgettext``, but look the message up in the specified
        `domain`.
        )r�r�r
�rr�r�r�r�r�s      r �
dnpgettextzNullTranslations.dnpgettext9s:���}� � ���.�.�8�8��(�9?��F�F�	Fr"c�d�|j�||���||||��S)zXLike ``unpgettext``, but look the message up in the specified
        `domain`.
        )r�r�rrs      r �udnpgettextzNullTranslations.udnpgettext@s:���}� � ���.�.�9�9�'�8�:@�#�G�G�	Gr"c�d�|j�||���||||��S)z�Equivalent to ``dnpgettext()``, but the translation is returned in
        the preferred system encoding, if no other encoding was explicitly set
        with ``bind_textdomain_codeset()``.
        )r�r�r
rs      r �ldnpgettextzNullTranslations.ldnpgettextIs:��
�}� � ���.�.�9�9�'�8�:@�#�G�G�	Gr"rZ)r�r�rr)r�r(r�r(rr()
r�r(r�r(r�r(r�rMrr()r�r(r�r(rr�)r�r(r�r(rr)
r�r(r�r(r�r(r�rMrr()
r�r(r�r(r�r(r�rMrr)r�r(r�r(rr()r�r(r�r(r�r(rr�)r�r(r�r(r�r(rr()r�r(r�r(r�r(rr)r�r(r�r(r�r(r�r(r�rMrr()r�r(r�r(r�r(r�r(r�rMrr)$r[r\r]rr�r�r!r�r�r��	dugettextr�r�r��
dungettextr�r�rr
r
rrrr�
dupgettextrrr�dunpgettextr r�r�r�r�r��
__classcell__�r�s@r r�r�hs5���������+�����*�*�*�*��N�8�8�8�8�8�8�8�"@�@�@�@�A�A�A�A�A�A�A�A��I�O�O�O�O�P�P�P�P�P�P�P�P��J�"������"
H�
H�
H�
H�����.����*����"����(J�J�J�J�K�K�K�K��J�K�K�K�K�F�F�F�F�G�G�G�G��K�G�G�G�G��'�/�H��(�1�I�I�I�I�Ir"r�c���eZdZdZdZdd�fd�
ZejjZejj	Z
e			ddd���Zdd�Z
ddd�Zdd�Z�xZS) �Translationsz&An extended translation catalog class.�messagesNr�r�r�rDc�h��t���|���|p|j|_dS)z�Initialize the translations catalog.

        :param fp: the file-like object the translation should be read from
        :param domain: the message domain (default: 'messages')
        r�N)r�r!r�r�)rr�r�r�s   �r r!zTranslations.__init__Zs3���	�����B������3�� 3����r"�dirname�str | os.PathLike[str] | None�locales�(list[str] | tuple[str, ...] | str | Nonerr�c�(�|�+t|ttf��s|g}d�|D��}|s|j}t	j|||��}|st
��St|d��5}|||���cddd��S#1swxYwYdS)apLoad translations from the given directory.

        :param dirname: the directory containing the ``MO`` files
        :param locales: the list of locales in order of preference (items in
                        this list can be either `Locale` objects or locale
                        strings)
        :param domain: the message domain (default: 'messages')
        Nc�,�g|]}t|����Sr_)r()�.0rs  r �
<listcomp>z%Translations.load.<locals>.<listcomp>xs��9�9�9�v�s�6�{�{�9�9�9r"�rb)r�r�)rr��tupler�r��findr��open)�clsr+r-r��filenamer�s      r �loadzTranslations.loadfs������g��e�}�5�5�
$�"�)��9�9��9�9�9�G��	(��'�F��<����9�9���	&�#�%�%�%�
�(�D�
!�
!�	-�R��3�"�V�,�,�,�	-�	-�	-�	-�	-�	-�	-�	-�	-�	-�	-�	-����	-�	-�	-�	-�	-�	-s�-
B�B�Br(c�l�|j�d��}dt|��j�d|�d�S)Nzproject-id-version�<z: "z">)r�r��typer[)r�versions  r �__repr__zTranslations.__repr__�s8���*�.�.�!5�6�6��6�4��:�:�&�6�6�7�6�6�6�6r"T�translations�merger<c�B�t|d|j��}|r ||jkr|�|��S|j�|��}|r+t
|t��r|�|��n|�|��||j|<|S)a!Add the given translations to the catalog.

        If the domain of the translations is different than that of the
        current catalog, they are added as a catalog that is only accessible
        by the various ``d*gettext`` functions.

        :param translations: the `Translations` instance with the messages to
                             add
        :param merge: whether translations for message domains that have
                      already been added should be merged with the existing
                      translations
        r�)	r�r�r�r@r�r�rr(�add_fallback)rr?r@r��existings     r �addzTranslations.add�s�����x��1D�E�E���	,�V�t�{�*�*��:�:�l�+�+�+��=�$�$�V�,�,���	1�Z��,�7�7�	1��N�N�<�(�(�(�(��%�%�d�+�+�+�$0�D�M�&�!��r"c���t|tj��rS|j�|j��t|t
��r|j�|j��|S)a0Merge the given translations into the catalog.

        Message translations in the specified catalog override any messages
        with the same identifier in the existing catalog.

        :param translations: the `Translations` instance with the messages to
                             merge
        )rr��GNUTranslationsr��updater(r��extend)rr?s  r r@zTranslations.merge�sb���l�G�$;�<�<�	6��M� � ��!6�7�7�7��,��5�5�
6��
�!�!�,�"4�5�5�5��r")NN)r�r�r�rD)NNN)r+r,r-r.r�rDrr�r�)T)r?r(r@r<)r?r()r[r\r]r^r�r!r�rFr�r�r��classmethodr9r>rDr@r%r&s@r r(r(Us��������0�0��N�4�4�4�4�4�4�4��&�.�H��'�0�I��26�<@�!�	-�-�-�-��[�-�47�7�7�7������4�������r"r()#r^�
__future__rrGr�r�os�collections.abcr�typingrrr�
babel.corer�babel.datesr	r
rr�
babel.numbersr
rrrrr�typing_extensionsrrrrar�rFr(r_r"r �<module>rRs����#�"�"�"�"�"���������
�
�
�
�	�	�	�	�$�$�$�$�$�$�/�/�/�/�/�/�/�/�/�/�������S�S�S�S�S�S�S�S�S�S�S�S������������������2�)�)�)�)�)�)�1�1�1�1�1�1�[=�[=�[=�[=�[=�[=�[=�[=�|`
�`
�`
�`
�`
�`
�`
�`
�Fj2�j2�j2�j2�j2�w�/�j2�j2�j2�ZX�X�X�X�X�#�W�%<�X�X�X�X�Xr"

?>