https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/django/middleware/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/django/middleware/__pycache__/locale.cpython-310.pyc
o

3�a��@slddlmZddlmZddlmZddlmZmZddl	m
Z
ddlmZddl
mZGdd	�d	e�Zd
S)�)�settings)� is_language_prefix_patterns_used)�HttpResponseRedirect)�get_script_prefix�
is_valid_path)�translation)�patch_vary_headers)�MiddlewareMixinc@s$eZdZdZeZdd�Zdd�ZdS)�LocaleMiddlewarez�
    Parse a request and decide what translation object to install in the
    current thread context. This allows pages to be dynamically translated to
    the language the user desires (if the language is available).
    cCs^t|dtj�}t|�\}}tj||d�}t�|j�}|s#|r#|s#tj}t�	|�t�
�|_dS)N�urlconf)�
check_path)�getattrr�ROOT_URLCONFrr�get_language_from_request�get_language_from_path�	path_info�
LANGUAGE_CODE�activate�get_language)�self�requestr�i18n_patterns_used�prefixed_default_language�language�language_from_path�r�:/usr/lib/python3/dist-packages/django/middleware/locale.py�process_requests
z LocaleMiddleware.process_requestc
Cs�t��}t�|j�}t|dtj�}t|�\}}|jdkr\|s\|r\|r\d||jf}t	||�}	|	o@tj
o@|�d�o@t	d||�}
|	sE|
r\t�}|j
|
d��|d||fd�}|�|�S|r`|set|d	�|j�d
|�|S)Nri�z/%s%s�/z%s/)�force_append_slashz%s%s/�)zAccept-LanguagezContent-Language)rrrrr
rrr�status_coder�APPEND_SLASH�endswithr�
get_full_path�replace�response_redirect_classr�headers�
setdefault)
rr�responserrrrr�
language_path�
path_valid�path_needs_slash�
script_prefix�language_urlrrr�process_responses6��
�
�

z!LocaleMiddleware.process_responseN)�__name__�
__module__�__qualname__�__doc__rr&rr/rrrrr

s

r
N)�django.confr�django.conf.urls.i18nr�django.httpr�django.urlsrr�django.utilsr�django.utils.cacher�django.utils.deprecationr	r
rrrr�<module>s

https://t.me/RX1948 - 2025