only take first locale

This commit is contained in:
j 2023-07-09 09:58:54 +05:30
parent 1175e5d5bf
commit e41b7e19d4

View file

@ -163,7 +163,7 @@ def init(request, data):
del config['keys'] del config['keys']
if 'HTTP_ACCEPT_LANGUAGE' in request.META: if 'HTTP_ACCEPT_LANGUAGE' in request.META:
response['data']['locale'] = request.META['HTTP_ACCEPT_LANGUAGE'].split(';')[0].split('-')[0] response['data']['locale'] = request.META['HTTP_ACCEPT_LANGUAGE'].split(';')[0].split('-')[0].split(',')[0]
if request.META.get('HTTP_X_PREFIX') == 'NO': if request.META.get('HTTP_X_PREFIX') == 'NO':
config['site']['videoprefix'] = '' config['site']['videoprefix'] = ''