search: make language configurable from settings.yml

This commit is contained in:
Noémi Ványi 2016-11-14 22:32:40 +01:00
parent 12c369e858
commit 299c882304
3 changed files with 4 additions and 1 deletions

View File

@ -216,7 +216,8 @@ class Preferences(object):
super(Preferences, self).__init__() super(Preferences, self).__init__()
self.key_value_settings = {'categories': MultipleChoiceSetting(['general'], choices=categories), self.key_value_settings = {'categories': MultipleChoiceSetting(['general'], choices=categories),
'language': EnumStringSetting('all', choices=LANGUAGE_CODES), 'language': EnumStringSetting(settings['search']['language'],
choices=LANGUAGE_CODES),
'locale': EnumStringSetting(settings['ui']['default_locale'], 'locale': EnumStringSetting(settings['ui']['default_locale'],
choices=settings['locales'].keys() + ['']), choices=settings['locales'].keys() + ['']),
'autocomplete': EnumStringSetting(settings['search']['autocomplete'], 'autocomplete': EnumStringSetting(settings['search']['autocomplete'],

View File

@ -5,6 +5,7 @@ general:
search: search:
safe_search : 0 # Filter results. 0: None, 1: Moderate, 2: Strict safe_search : 0 # Filter results. 0: None, 1: Moderate, 2: Strict
autocomplete : "" # Existing autocomplete backends: "dbpedia", "duckduckgo", "google", "startpage", "wikipedia" - leave blank to turn it off by default autocomplete : "" # Existing autocomplete backends: "dbpedia", "duckduckgo", "google", "startpage", "wikipedia" - leave blank to turn it off by default
language : "all"
server: server:
port : 8888 port : 8888

View File

@ -5,6 +5,7 @@ general:
search: search:
safe_search : 0 safe_search : 0
autocomplete : "" autocomplete : ""
language: "all"
server: server:
port : 11111 port : 11111