searxngRebrandZaclys/searx
Markus Heiser 19e41c137e [mod] set 'engine.supported_languages' from the origin python module
The key of the dictionary 'searx.data.ENGINES_LANGUAGES' is the *engine name*
configured in settings.xml.  When multiple engines are configured to use the
same origin engine (e.g. `engine: google`)::

    - name: google
      engine: google
      use_mobile_ui: false
      ...

    - name: google italian
      engine: google
      use_mobile_ui: false
      language: it
      ...

    - name: google mobile ui
      engine: google
      shortcut: gomui
      use_mobile_ui: true

There exists no entry for ENGINES_LANGUAGES[engine.name] (e.g. `name: google
mobile ui` or `name: google italian`).  This issue can be solved by recreate the
ENGINES_LANGUAGES::

    make data.languages

But this is nothing an SearXNG admin would like to do when just configuring
additional engines, since this just doubles entries in ENGINES_LANGUAGES and
BTW: `make data.languages` has various external requirements which might be not
installed or not available, on a production host.

With this patch, if engine.name fails, ENGINES_LANGUAGES[engine.engine] is used
to get the engine.supported_languages (e.g. `google` for the engine named
`google mobile`).

For an engine, when there is `language: ...` in the YAML settings, the engine
supports only one language, in this case engine.supported_languages should
contains this value defined in settings.yml (e.g. `it` for the engine named
`google italian`).

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Closes: https://github.com/searxng/searxng/issues/384
2021-10-07 08:45:02 +02:00
..
answerers [fix] answers: don't crash when the query is an empty string 2021-03-01 10:52:39 +01:00
data SearXNG: searxng_extra 2021-10-02 17:30:39 +02:00
engines [mod] set 'engine.supported_languages' from the origin python module 2021-10-07 08:45:02 +02:00
metrics [fix] error recorder: avoid RuntimeError on some rare occasion 2021-09-17 10:06:24 +02:00
network [mod] searx.network.stream returns a tuple (response, stream) 2021-09-28 19:33:29 +02:00
plugins [enh] add hostname_replace plugin 2021-09-11 13:23:06 +02:00
search [fix] searx.network.stream: fix memory leak 2021-09-28 19:28:12 +02:00
shared [fix] checker: don't run the checker when uwsgi is not properly configured 2021-01-13 14:07:39 +01:00
static [build] /static 2021-10-03 19:04:18 +02:00
templates Merge pull request #367 from dalf/searxng-github 2021-10-02 07:57:49 +02:00
translations [translations] update 2021-09-17 13:50:32 +00:00
__init__.py SearXNG: environment variables 2021-10-02 16:54:11 +02:00
autocomplete.py [httpx] replace searx.poolrequests by searx.network 2021-04-12 17:25:56 +02:00
exceptions.py [enh] add raise_for_httperror 2020-12-11 14:37:08 +01:00
external_bang.py [pylint] fix global-variable-not-assigned issues 2021-09-17 10:14:27 +02:00
external_urls.py [enh] openstreetmap / map template: improve results 2021-06-09 18:08:23 +02:00
flaskfix.py [pylint] searx: drop no longer needed 'missing-function-docstring' 2021-09-07 13:34:35 +02:00
languages.py Update searx.data - update_languages.py 2021-10-01 06:23:31 +00:00
locales.py [pylint] fix global-variable-not-assigned issues 2021-09-17 10:14:27 +02:00
preferences.py [pylint] searx: drop no longer needed 'missing-function-docstring' 2021-09-07 13:34:35 +02:00
query.py [enh] autocomplete refactoring, autocomplete on external bangs 2021-03-01 19:12:32 +01:00
results.py [fix] searx/results.py: strip result['content'] only if it exists 2021-09-10 17:58:19 +02:00
settings_defaults.py SearXNG: environment variables 2021-10-02 16:54:11 +02:00
settings_loader.py SearXNG: environment variables 2021-10-02 16:54:11 +02:00
settings.yml [mod] set 'engine.supported_languages' from the origin python module 2021-10-07 08:45:02 +02:00
unixthreadname.py [pylint] searx: drop no longer needed 'missing-function-docstring' 2021-09-07 13:34:35 +02:00
utils.py [mod] searx.utils.dict_subset: rewrite with comprehension 2021-08-24 15:28:08 +02:00
version.py [pylint] searx: drop no longer needed 'missing-function-docstring' 2021-09-07 13:34:35 +02:00
webadapter.py [fix] typo in searx.webadapter.parse_lang 2021-09-04 08:39:45 +02:00
webapp.py [mod] searx.network.stream returns a tuple (response, stream) 2021-09-28 19:33:29 +02:00
webutils.py [mod] move all default settings into searx.settings_defaults 2021-06-01 08:10:15 +02:00