1
0
mirror of https://github.com/searxng/searxng.git synced 2024-11-05 12:50:11 +01:00
searxng/searx
Markus Heiser 16f0db4493 [mod] replace utils.match_language by locales.match_locale
This patch replaces the *full of magic* ``utils.match_language`` function by a
``locales.match_locale``.  The ``locales.match_locale`` function is based on the
``locales.build_engine_locales`` introduced in 9ae409a0 [1].

In the past SearXNG did only support a search by a language but not in a region.
This has been changed a long time ago and regions have been added to SearXNG
core but not to the engines.  The ``utils.match_language`` was the function to
handle the different aspects of language/regions in SearXNG core and the
supported *languages* in the engine.  The ``utils.match_language`` did it with
some magic and works good for most use cases but fails in some edge case.

To replace the concurrence of languages and regions in the SearXNG core the
``locales.build_engine_locales`` was introduced in 9ae409a0 [1].  With the last
patches all engines has been migrated to a ``fetch_traits`` and a
language/region concept that is based on ``locales.build_engine_locales``.

To summarize: there is no longer a need for the ``locales.match_language``.

[1] https://github.com/searxng/searxng/pull/1652

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2023-03-24 10:37:42 +01:00
..
answerers [fix] issue reported by pylint 22.1.0 2022-02-04 09:45:35 +01:00
data [mod] remove obsolete EngineTraits.supported_languages 2023-03-24 10:37:42 +01:00
enginelib [mod] remove obsolete EngineTraits.supported_languages 2023-03-24 10:37:42 +01:00
engines [mod] remove obsolete EngineTraits.supported_languages 2023-03-24 10:37:42 +01:00
infopage weblate: migration to https://translate.codeberg.org/ 2023-01-21 15:45:12 +00:00
metrics [fix] prepare for pylint 2.14.0 2022-06-03 15:41:52 +02:00
network [mod] Shuffle httpx's default ciphers of a SSL context randomly. 2023-03-19 13:40:31 +01:00
plugins Add "Auto-detected" as a language. 2023-02-17 15:17:36 +00:00
search [mod] remove obsolete EngineTraits.supported_languages 2023-03-24 10:37:42 +01:00
static [fix] remove duplicate key in simple theme ESLint configuration 2023-03-05 09:12:13 +01:00
templates/simple [mod] replace searx.languages by searx.sxng_locales 2023-03-24 10:37:42 +01:00
translations [translations] update from Weblate 2023-03-24 07:07:52 +00:00
__init__.py [format.python] initial formatting of the python code 2021-12-27 09:26:22 +01:00
autocomplete.py [mod] remove obsolete EngineTraits.supported_languages 2023-03-24 10:37:42 +01:00
babel_extract.py [mod] move category and names of constants to searx/searxng.msg 2022-03-16 09:55:53 +01:00
compat.py [fix] pyright repported errors 2022-07-30 18:04:44 +02:00
exceptions.py [doc] Add doc-strings to searx.exceptions 2023-01-29 19:06:19 +01:00
external_bang.py External bang: bug fix: URL encode the query so "!!g 1+1" works as intended 2022-08-27 07:10:26 +00:00
external_urls.py [fix] typos / reported by @kianmeng in searx PR-3366 2022-09-27 18:32:14 +02:00
flaskfix.py [format.python] initial formatting of the python code 2021-12-27 09:26:22 +01:00
locales.py [mod] replace utils.match_language by locales.match_locale 2023-03-24 10:37:42 +01:00
preferences.py [mod] replace engines_languages.json by engines_traits.json 2023-03-24 10:37:42 +01:00
query.py [mod] replace searx.languages by searx.sxng_locales 2023-03-24 10:37:42 +01:00
redisdb.py move searx.shared.redisdb to searx.redisdb 2022-12-10 09:26:38 +01:00
redislib.py [mod] redislib - optimize LUA script registration. 2022-05-30 11:21:09 +02:00
results.py [fix] typos / reported by @kianmeng in searx PR-3366 2022-09-27 18:32:14 +02:00
searxng.msg Science category: update the engines 2022-09-23 20:45:58 +02:00
settings_defaults.py [mod] replace searx.languages by searx.sxng_locales 2023-03-24 10:37:42 +01:00
settings_loader.py [fix] typos / reported by @kianmeng in searx PR-3366 2022-09-27 18:32:14 +02:00
settings.yml [mod] Google: reversed engineered & upgrade to data_type: traits_v1 2023-03-24 10:37:42 +01:00
sxng_locales.py [mod] Archlinux Wiki: improved request API & upgrade to data_type: traits_v1 2023-03-24 10:37:42 +01:00
unixthreadname.py [format.python] initial formatting of the python code 2021-12-27 09:26:22 +01:00
utils.py [mod] replace utils.match_language by locales.match_locale 2023-03-24 10:37:42 +01:00
version.py SearXNG version: YYYY.MM.DD without leading zero 2023-01-22 10:45:00 +00:00
webadapter.py Add "Auto-detected" as a language. 2023-02-17 15:17:36 +00:00
webapp.py [mod] replace utils.match_language by locales.match_locale 2023-03-24 10:37:42 +01:00
webutils.py [mod] replace engines_languages.json by engines_traits.json 2023-03-24 10:37:42 +01:00