Przeglądaj źródła

search: make language configurable from settings.yml

Noémi Ványi 8 lat temu
rodzic
commit
299c882304
3 zmienionych plików z 4 dodań i 1 usunięć
  1. 2
    1
      searx/preferences.py
  2. 1
    0
      searx/settings.yml
  3. 1
    0
      searx/settings_robot.yml

+ 2
- 1
searx/preferences.py Wyświetl plik

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

+ 1
- 0
searx/settings.yml Wyświetl plik

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

+ 1
- 0
searx/settings_robot.yml Wyświetl plik

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