logo

searx

My custom branche(s) on searx, a meta-search engine
commit: 08c2e263f55d92296c5950a0b5de57ef4e8716a4
parent: 317bce74dd8096c64ad9f988745c2c5a9fe8fb36
Author: Adam Tauber <asciimoo@gmail.com>
Date:   Sat, 17 Jan 2015 20:38:46 +0100

[enh] configurable default interface locale - #177

Diffstat:

Msearx/settings.yml1+
Msearx/webapp.py3+++
2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/searx/settings.yml b/searx/settings.yml @@ -9,6 +9,7 @@ server: https_rewrite : True # Force rewrite result urls. See searx/https_rewrite.py useragent_suffix : "" # suffix of searx_useragent, could contain informations like an email address to the administrator image_proxy : False # Proxying image results through searx + default_locale : "" # Default interface locale - leave blank to detect from browser information engines: - name : wikipedia diff --git a/searx/webapp.py b/searx/webapp.py @@ -97,6 +97,9 @@ cookie_max_age = 60 * 60 * 24 * 365 * 23 # 23 years def get_locale(): locale = request.accept_languages.best_match(settings['locales'].keys()) + if settings['server'].get('default_locale'): + locale = settings['server']['default_locale'] + if request.cookies.get('locale', '') in settings['locales']: locale = request.cookies.get('locale', '')