a
    یxd
                     @   sH   d dl Z d dlZd dlZeeZG dd de jZG dd deZ	dS )    Nc                   @   s   e Zd Zdd ZdS )FallBackNullc                 C   s   dS )N  )selfmessager   r   O/var/www/html/Ranjet/env/lib/python3.9/site-packages/cron_descriptor/GetText.pygettext    s    zFallBackNull.gettextN)__name__
__module____qualname__r   r   r   r   r   r      s   r   c                   @   s$   e Zd ZdZdddZdddZdS )	GetTextz'
    Handles language translations
    Nc                 C   s^   z|  ||| _W n8 tyJ   td| td |  d| _Y n0 | jt  dS )zO
        Initialize GetText
        :param locale_code selected locale
        zFailed to find locale {}z$Attempting to load en_US as fallbacken_USN)load_localetransIOErrorloggerdebugformatadd_fallbackr   )r   locale_codelocale_locationr   r   r   __init__*   s    
zGetText.__init__c                 C   s   |d u r0t jt jt jtdd|}nt j|d|}t|d}t	|}W d    n1 sn0    Y  t
d| |S )Nlocalez{}.morbz	{} Loaded)ospathjoindirnameabspath__file__r   openr   GNUTranslationsr   r   )r   r   r   filenamefr   r   r   r   r   :   s    ((zGetText.load_locale)N)N)r	   r
   r   __doc__r   r   r   r   r   r   r   %   s   
r   )
r   r   logging	getLoggerr	   r   NullTranslationsr   objectr   r   r   r   r   <module>   s
   
