mirror of
				https://github.com/janeczku/calibre-web
				synced 2025-10-30 23:03:02 +00:00 
			
		
		
		
	Merge remote-tracking branch '681/681-fix'
This commit is contained in:
		| @@ -196,13 +196,8 @@ def get_locale(): | ||||
|     if user is not None and hasattr(user, "locale"): | ||||
|         if user.nickname != 'Guest':   # if the account is the guest account bypass the config lang settings | ||||
|             return user.locale | ||||
|     translations = [item.language for item in babel.list_translations()] + ['en'] | ||||
|     preferred = [x.replace('-', '_') for x in request.accept_languages.values()] | ||||
|  | ||||
|     # In the case of Simplified Chinese, Accept-Language is "zh-CN", while our translation of Simplified Chinese is "zh_Hans_CN". | ||||
|     # TODO: This is Not a good solution, should be improved. | ||||
|     if "zh_CN" in preferred: | ||||
|         return "zh_Hans_CN" | ||||
|     translations = [str(item) for item in babel.list_translations()] + ['en'] | ||||
|     preferred = [str(LC.parse(x.replace('-','_'))) for x in request.accept_languages.values()] | ||||
|     return negotiate_locale(preferred, translations) | ||||
|  | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Ozzieisaacs
					Ozzieisaacs