
    Ī5h&                       U d Z ddlmZ ddlZddlmZ dZerddlZddl	Z	g dZ
d ej                         iZded<    e       Zd	d
d	d	d
dZdd	ddddZddZddZ	 d	 	 	 	 	 ddZddZddZddZddZddZd dZd!dZd!dZy)"z*Activate, get and deactivate translations.    )annotationsN)localF)activate
deactivatedecimal_separatorthousands_separatorz1dict[str | None, gettext_module.NullTranslations]_TRANSLATIONS. )de_DEfr_FRit_ITpt_BRhu_HU,c                     t         xr t         j                  } | sy dd l}|j                  j	                  |j                  j                  |             5 }|dz  cd d d        S # 1 sw Y   y xY w)Nr   locale)__spec__parentimportlib.resources	resourcesas_filefiles)package	importlibpkgs      S/var/www/html/Kila-kolis-project/venv/lib/python3.12/site-packages/humanize/i18n.py_get_default_locale_pathr   (   sT    *8??G				$	$Y%8%8%>%>w%G	HCX~ 
I	H	Hs   A##A,c                 n    	 t         t        j                     S # t        t        f$ r t         d    cY S w xY wN)r	   _CURRENTr   AttributeErrorKeyError     r   get_translationr&   3   s5    #X__--H% #T""#s    44c                    | | j                  d      rdt        _        t        d   S |
t	               }|d}t        |      | t        vr!t        j                  d|| g      }|t        | <   | t        _        t        |    S )a  Activate internationalisation.

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

    Args:
        locale (str | None): Language name, e.g. `en_GB`. If `None`, defaults to no
            transaltion. Similar to calling ``deactivate()``.
        path (str | pathlib.Path): Path to search for locales.

    Returns:
        dict: Translations.

    Raises:
        Exception: If humanize cannot find the locale folder.
    NenznHumanize cannot determinate the default location of the 'locale' folder. You need to pass the path explicitly.humanize)
startswithr!   r   r	   r   	Exceptiongettext_moduletranslation)r   pathmsgr-   s       r   r   r   :   s    $ ~**40T""|')|4 	 n]"$00TF8L +fHO  r%   c                     dt         _        y)z Deactivate internationalisation.N)r!   r   r$   r%   r   r   r   `   s	    HOr%   c                4    t               j                  |       S )zvGet translation.

    Args:
        message (str): Text to translate.

    Returns:
        str: Translated text.
    )r&   gettextmessages    r   _gettextr5   e   s     $$W--r%   c                6    t               j                  | |      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)msgctxtr4   s     r   	_pgettextr9   q   s     %%gw77r%   c                8    t               j                  | ||      S )a6  Plural 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)r4   pluralnums      r   	_ngettextr>      s     %%gvs;;r%   c                    | S )aa  Mark 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.
    r$   r3   s    r   _gettext_noopr@      s	      Nr%   c                
    | |fS )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$   )singularr<   s     r   _ngettext_nooprC      s    " Vr%   c                 f    	 t         t        j                     } | S # t        t        f$ r d} Y | S w xY w)ztReturn the thousands separator for a locale, default to comma.

    Returns:
         str: Thousands separator.
    r   )_THOUSANDS_SEPARATORr!   r   r"   r#   seps    r   r   r      s<    "8??3 J H% J    00c                 f    	 t         t        j                     } | S # t        t        f$ r d} Y | S w xY w)znReturn the decimal separator for a locale, default to dot.

    Returns:
         str: Decimal separator.
    r
   )_DECIMAL_SEPARATORr!   r   r"   r#   rF   s    r   r   r      s<     1 J H% JrH   )returnzpathlib.Path | None)rK   gettext_module.NullTranslationsr    )r   z
str | Noner.   zstr | os.PathLike[str] | NonerK   rL   )rK   None)r4   strrK   rN   )r8   rN   r4   rN   rK   rN   )r4   rN   r<   rN   r=   intrK   rN   )rB   rN   r<   rN   rK   ztuple[str, str])rK   rN   )__doc__
__future__r   r2   r,   	threadingr   TYPE_CHECKINGospathlib__all__NullTranslationsr	   __annotations__r!   rE   rJ   r   r&   r   r   r5   r9   r>   r@   rC   r   r   r$   r%   r   <module>rY      s    0 "   
P 	
).
)
)
+D@  7
    # ?C#!#!;#!$#!L
	.8 <&(

r%   