dont set default locale in user.ui and use first browser locale by default if available and fall back to site default after that, fixes #1578; load locale from unjoined json files in debug mode
This commit is contained in:
parent
24afe66c75
commit
5489823a61
7 changed files with 29 additions and 10 deletions
|
|
@ -154,6 +154,8 @@ def init(request):
|
|||
config = copy.deepcopy(settings.CONFIG)
|
||||
del config['keys']
|
||||
|
||||
if 'HTTP_ACCEPT_LANGUAGE' in request.META:
|
||||
response['data']['locale'] = request.META['HTTP_ACCEPT_LANGUAGE'].split(';')[0].split('-')[0]
|
||||
response['data']['site'] = config
|
||||
response['data']['user'] = init_user(request.user, request)
|
||||
request.session['last_init'] = str(datetime.now())
|
||||
|
|
|
|||
|
|
@ -716,6 +716,7 @@
|
|||
"system": "0xDB@0xDB.org"
|
||||
},
|
||||
"https": true,
|
||||
"locale": "en",
|
||||
"id": "0xdb",
|
||||
"name": "0xDB",
|
||||
"url": "0xDB.org",
|
||||
|
|
@ -803,7 +804,7 @@
|
|||
"listSort": [{"key": "director", "operator": "+"}],
|
||||
"listView": "grid",
|
||||
"lists": {},
|
||||
"locale": "en",
|
||||
"locale": "",
|
||||
"mapFind": "",
|
||||
"mapSelection": "",
|
||||
"page": "",
|
||||
|
|
|
|||
|
|
@ -729,6 +729,7 @@
|
|||
},
|
||||
"folderdepth": 4,
|
||||
"https": true,
|
||||
"locale": "en",
|
||||
"id": "indiancinema",
|
||||
"name": "Indiancine.ma",
|
||||
"url": "indiancine.ma",
|
||||
|
|
@ -815,7 +816,7 @@
|
|||
"listSort": [{"key": "year", "operator": "+"}],
|
||||
"listView": "grid",
|
||||
"lists": {},
|
||||
"locale": "en",
|
||||
"locale": "",
|
||||
"mapFind": "",
|
||||
"mapSelection": "",
|
||||
"page": "",
|
||||
|
|
|
|||
|
|
@ -607,6 +607,7 @@
|
|||
"system": "system@pad.ma"
|
||||
},
|
||||
"https": true,
|
||||
"locale": "en",
|
||||
"id": "padma",
|
||||
"name": "Pad.ma",
|
||||
"url": "pad.ma",
|
||||
|
|
@ -693,7 +694,7 @@
|
|||
"listSort": [{"key": "title", "operator": "+"}],
|
||||
"listView": "grid",
|
||||
"lists": {},
|
||||
"locale": "en",
|
||||
"locale": "",
|
||||
"mapFind": "",
|
||||
"mapSelection": "",
|
||||
"page": "",
|
||||
|
|
|
|||
|
|
@ -527,6 +527,7 @@
|
|||
},
|
||||
"https": false,
|
||||
"id": "pandora",
|
||||
"locale": "en",
|
||||
"name": "Demo",
|
||||
"url": "pandora.local",
|
||||
"videoprefix": ""
|
||||
|
|
@ -612,7 +613,7 @@
|
|||
"listSort": [{"key": "title", "operator": "+"}],
|
||||
"listView": "grid",
|
||||
"lists": {},
|
||||
"locale": "en",
|
||||
"locale": "",
|
||||
"mapFind": "",
|
||||
"mapSelection": "",
|
||||
"page": "",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue