o
    vZŽhS  ã                   @   sZ   d dl mZ d dlmZ d dlZdgZe e¡Ze 	e 
¡ ¡ dd„ Zdd„ Zdd	„ ZdS )
é    )Ú_main_langs)ÚwarnNÚ	tts_langsc                  C   s2   t ƒ } |  tƒ ¡ |  tƒ ¡ t d | ¡¡ | S )a]  Languages Google Text-to-Speech supports.

    Returns:
        dict: A dictionary of the type `{ '<lang>': '<name>'}`

            Where `<lang>` is an IETF language tag such as `en` or `zh-TW`,
            and `<name>` is the full English name of the language, such as
            `English` or `Chinese (Mandarin/Taiwan)`.

    The dictionary returned combines languages from two origins:

    - Languages fetched from Google Translate (pre-generated in :mod:`gtts.langs`)
    - Languages that are undocumented variations that were observed to work and
      present different dialects or accents.

    z	langs: {})ÚdictÚupdater   Ú_extra_langsÚlogÚdebugÚformat)Zlangs© r   ú8/var/www/auris/lib/python3.10/site-packages/gtts/lang.pyr      s
   c                   C   s
   dddœS )a9  Define extra languages.

    Returns:
        dict: A dictionary of extra languages manually defined.

            Variations of the ones generated in `_main_langs`,
            observed to provide different dialects or accents or
            just simply accepted by the Google Translate Text-to-Speech API.

    zChinese (Mandarin/Taiwan)zChinese (Mandarin))úzh-TWÚzhr   r   r   r   r   r   %   s   ýr   c                 C   sp   g d¢ddgddgddgdgd	gd
œ}|  ¡ D ]\}}|  ¡ |v r5d | |¡}t|tƒ t |¡ |  S q| S )a±  Languages Google Text-to-Speech used to support.

    Language tags that don't work anymore, but that can
    fallback to a more general language code to maintain
    compatibility.

    Args:
        lang (string): The language tag.

    Returns:
        string: The language tag, as-is if not deprecated,
            or a fallback if it exits.

    Example:
        ``en-GB`` returns ``en``.
        ``en-gb`` returns ``en``.

    )zen-uszen-cazen-ukzen-gbzen-auzen-ghzen-inzen-iezen-nzzen-ngzen-phzen-zazen-tzzfr-cazfr-frzpt-brzpt-ptzes-eszes-uszzh-cnzzh-tw)ÚenÚfrÚptÚeszzh-CNr   zb'{}' has been deprecated, falling back to '{}'. This fallback will be removed in a future version.)ÚitemsÚlowerr
   r   ÚDeprecationWarningr   Úwarning)ÚlangÚ
deprecatedZfallback_langZdeprecated_langsÚmsgr   r   r   Ú_fallback_deprecated_lang7   s"   ëý

÷r   )Z
gtts.langsr   Úwarningsr   ÚloggingÚ__all__Ú	getLoggerÚ__name__r   Ú
addHandlerÚNullHandlerr   r   r   r   r   r   r   Ú<module>   s   
