
    k"gZ                     @    d dl mZ d dlmZ d dlmZ d dlmZ d Zd Z	y)    Path)Local)apps)is_django_modulec                    ddl m} |j                  rrt        d      g}|j	                  d t        j                         D               |j	                  d |j                  D               |D ]  }| j                  |d        yy)z?Register file watchers for .mo files in potential locale paths.r   )settingslocalec              3   v   K   | ]1  }t        |j                        st        |j                        d z   3 yw)r
   N)r   moduler   path).0configs     Z/var/www/html/djangosite/lib/python3.12/site-packages/django/utils/translation/reloader.py	<genexpr>z0watch_for_translation_changes.<locals>.<genexpr>   s2      
#FMM2 (
s   79c              3   2   K   | ]  }t        |        y w)Nr   )r   ps     r   r   z0watch_for_translation_changes.<locals>.<genexpr>   s     Bq47Bs   z**/*.moN)	django.confr	   USE_I18Nr   extendr   get_app_configsLOCALE_PATHS	watch_dir)senderkwargsr	   directoriesr   s        r   watch_for_translation_changesr   	   s~    $H~& 
..0
 	

 	BH,A,ABB 	.DT9-	.     c                     |j                   dk(  r/ddl}ddlm} i |_        i |_        d|_        t               |_        yy)z@Clear the internal translations cache if a .mo file is modified.z.mor   N)
trans_realT)suffixgettextdjango.utils.translationr    _translations_defaultr   _active)r   	file_pathr   r"   r    s        r   translation_file_changedr(      s@    5 7 "#%
 "
"W
 !r   N)
pathlibr   asgiref.localr   django.appsr   django.utils.autoreloadr   r   r(    r   r   <module>r.      s       4. r   