
    soj                         U d Z ddlZddlmZ ddlmZ ddlmZ ddlm	Z	 ddl
mZ e	j        ee	j        eiZee	ef         ed<    G d de          Zeej        e         _        dS )	a  
This module is a drop-in replacement for what used to be a plain module of English string
constants. It transparently resolves every phrase to the language currently active for the
chat being processed (see src.service.language_service), while every other part of the
codebase keeps using it exactly as before, e.g. `from resources import phrases` then
`phrases.SOME_CONSTANT`.

How it works:
    - resources/phrases_en.py holds the original English constants (source of truth).
    - resources/phrases_fa.py holds the Persian (Farsi) translations, using the exact same
      constant names.
    - This module dynamically resolves `phrases.SOME_CONSTANT` to the value defined in the
      currently active language's module, falling back to English if a translation is
      missing, so a missing/incomplete translation never breaks the Bot.

If a new phrase constant is added, it only needs to be added to phrases_en.py (and ideally
phrases_fa.py too). No changes are required in this file.
    N)
ModuleType)Language)get_current_language_LANGUAGE_MODULESc                       e Zd ZdZdefdZdS )_PhrasesModulez
    Proxy module that resolves attribute access to the phrase defined for the currently
    active language, falling back to English if not found.
    itemc                     t                      }t                              |t                    }	 t	          ||          S # t
          $ r t	          t          |          cY S w xY w)N)r   r   get
phrases_engetattrAttributeError)selfr	   languagemodules       /app/resources/phrases.py__getattr__z_PhrasesModule.__getattr__(   sh    '))"&&x<<	-64((( 	- 	- 	-:t,,,,,	-s   A   A"!A"N)__name__
__module____qualname____doc__strr        r   r   r   "   s9         
- - - - - - -r   r   )r   systypesr   resources.phrases_enr   resources.phrases_fa
phrases_fasrc.model.enums.Languager   src.service.language_servicer   ENGLISHPERSIANr   dict__annotations__r   modulesr   	__class__r   r   r   <module>r(      s     & 


       ) ) ) ) ) ) ) ) ) ) ) ) - - - - - - = = = = = = jj1 4*,-   - - - - -Z - - -" #1H    r   