HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //home/arjun/projects/env/lib64/python3.10/site-packages/humanize/__pycache__/i18n.cpython-310.pyc
o

we��@s�UdZddlmZddlZddlZddlmZgd�Z	de�
�iZded<e�Z
dd	ddd	d
�Zddddd�Zd1dd�Zd2dd�Zd3d4dd�Zd5dd�Zd6dd�Zd7d d!�Zd8d%d&�Zd6d'd(�Zd9d+d,�Zd:d-d.�Zd:d/d0�ZdS);z*Activate, get and deactivate translations.�)�annotationsN)�local)�activate�
deactivate�decimal_separator�thousands_separatorz1dict[str | None, gettext_module.NullTranslations]�
_TRANSLATIONS�.� )�de_DE�fr_FR�it_IT�pt_BR�hu_HU�,)rr
rr�return�
str | NonecCs<ztdurWdStj�tj�t�d�WStyYdSw)N�locale)�__file__�os�path�join�dirname�	NameError�rr�F/home/arjun/projects/env/lib/python3.10/site-packages/humanize/i18n.py�_get_default_locale_path"s�r�gettext_module.NullTranslationsc	Cs,zttjWSttfytdYSw�N)r�_CURRENTr�AttributeError�KeyErrorrrrr�get_translation+s
�r"r�strrcCsP|durt�}|durd}t|��|tvr!t�d||g�}|t|<|t_t|S)aRActivate internationalisation.

    Set `locale` as current locale. Search for locale in directory `path`.

    Args:
        locale (str): Language name, e.g. `en_GB`.
        path (str): Path to search for locales.

    Returns:
        dict: Translations.

    Raises:
        Exception: If humanize cannot find the locale folder.
    NznHumanize cannot determinate the default location of the 'locale' folder. You need to pass the path explicitly.�humanize)r�	Exceptionr�gettext_module�translationrr)rr�msgr'rrrr2s�r�NonecCs
dt_dS)z Deactivate internationalisation.N)rrrrrrrQs
r�messagecCst��|�S)zvGet translation.

    Args:
        message (str): Text to translate.

    Returns:
        str: Translated text.
    )r"�gettext�r*rrr�_gettextVs	r-�msgctxtcCst��||�S)a Fetches a particular translation.

    It works with `msgctxt` .po modifiers and allows duplicate keys with different
    translations.

    Args:
        msgctxt (str): Context of the translation.
        message (str): Text to translate.

    Returns:
        str: Translated text.
    )r"�pgettext)r.r*rrr�	_pgettextbs
r0�plural�num�intcCst��|||�S)a6Plural version of _gettext.

    Args:
        message (str): Singular text to translate.
        plural (str): Plural text to translate.
        num (int): The number (e.g. item count) to determine translation for the
            respective grammatical number.

    Returns:
        str: Translated text.
    )r"�ngettext)r*r1r2rrr�	_ngettextrsr5cCs|S)aaMark a string as a translation string without translating it.

    Example usage:
    ```python
    CONSTANTS = [_gettext_noop('first'), _gettext_noop('second')]
    def num_name(n):
        return _gettext(CONSTANTS[n])
    ```

    Args:
        message (str): Text to translate in the future.

    Returns:
        str: Original text, unchanged.
    rr,rrr�
_gettext_noop�sr6�singular�tuple[str, str]cCs||fS)a�Mark two strings as pluralized translations without translating them.

    Example usage:
    ```python
    CONSTANTS = [ngettext_noop('first', 'firsts'), ngettext_noop('second', 'seconds')]
    def num_name(n):
        return _ngettext(*CONSTANTS[n])
    ```

    Args:
        singular (str): Singular text to translate in the future.
        plural (str): Plural text to translate in the future.

    Returns:
        tuple: Original text, unchanged.
    r)r7r1rrr�_ngettext_noop�sr9c	C�.zttj}W|Sttfyd}Y|Sw)ztReturn the thousands separator for a locale, default to comma.

    Returns:
         str: Thousands separator.
    r)�_THOUSANDS_SEPARATORrrr r!��seprrrr����rc	Cr:)znReturn the decimal separator for a locale, default to dot.

    Returns:
         str: Decimal separator.
    r	)�_DECIMAL_SEPARATORrrr r!r<rrrr�r>r)rr)rrr)rr#rrrr)rr))r*r#rr#)r.r#r*r#rr#)r*r#r1r#r2r3rr#)r7r#r1r#rr8)rr#)�__doc__�
__future__rr+r&�os.pathr�	threadingr�__all__�NullTranslationsr�__annotations__rr;r?rr"rrr-r0r5r6r9rrrrrr�<module>s>��
�