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
..
2021-07-16 01:36:34 -07:00
2021-01-14 20:57:17 +01:00
2021-01-14 20:57:17 +01:00
2021-02-22 21:19:34 +01:00
2021-02-04 11:31:35 +01:00
2021-01-14 20:57:17 +01:00
2021-01-14 20:57:17 +01:00
2021-01-14 20:57:17 +01:00
2021-01-14 20:57:17 +01:00
2021-01-14 20:57:17 +01:00
2021-01-14 20:57:17 +01:00
2021-03-01 08:52:36 +01:00
2021-01-14 20:57:17 +01:00
2021-01-14 20:57:17 +01:00
2021-10-05 09:10:02 +02:00
2021-02-09 12:45:39 +01:00
2021-01-14 20:57:17 +01:00
2021-01-14 20:57:17 +01:00
2021-02-07 10:05:35 -03:00
2021-01-14 20:57:17 +01:00
2021-04-21 16:31:29 +02:00
2021-01-14 20:57:17 +01:00
2021-01-14 20:57:17 +01:00
2021-04-10 15:38:33 +02:00