Search ads uchun api chiqarildi
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
from .cache import * # noqa
|
||||
from .console import * # noqa
|
||||
from .core import * # noqa
|
||||
from .language import * # noqa
|
||||
|
||||
8
core/utils/language.py
Normal file
8
core/utils/language.py
Normal file
@@ -0,0 +1,8 @@
|
||||
def get_request_lang(request):
|
||||
lang = request.headers.get("Accept-Language", "uz")
|
||||
lang = lang.split(",")[0].split("-")[0].lower()
|
||||
|
||||
if lang not in ["uz", "ru", "en"]:
|
||||
lang = "uz"
|
||||
|
||||
return lang
|
||||
Reference in New Issue
Block a user