summaryrefslogtreecommitdiff
path: root/searxng_extra
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarit.de>2022-04-22 12:09:42 +0200
committerMarkus Heiser <markus.heiser@darmarit.de>2022-04-22 12:09:42 +0200
commit62982c8812c31249ab0cf3d0a8ca97eb439abf5e (patch)
tree42a575861eff0988111ab82c0959d1be12d59254 /searxng_extra
parent4ea33bddcf442ddb21c5f1d9a22fb11d47d0fee5 (diff)
[fix] add back missing languages & regions (followup of PR #1071)
In PR #1071 the language catalog of dailymotion has been cleaned up, before there had been over 7000 "languages" in the catalog. As a side effect of this clean-up the language & region catalog in SearXNG has been reduced [1]. This patch reduce the ``min_engines_per_lang`` from 13 to 12 to get the missed languages back in language & region catalog of SearXNG. [1] https://github.com/searxng/searxng/pull/1071/commits/3bb62823ec3af0e67bd2d959bec20c4791ee3bac#diff-f3f00db0f87f95b882624a192e0aac21525638af0b18c9514e765fcf1991678d Requested-by: @tiekoetter in a Matrix chat Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'searxng_extra')
-rwxr-xr-xsearxng_extra/update/update_languages.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/searxng_extra/update/update_languages.py b/searxng_extra/update/update_languages.py
index 95ee5bd3..5baf2fc5 100755
--- a/searxng_extra/update/update_languages.py
+++ b/searxng_extra/update/update_languages.py
@@ -117,7 +117,8 @@ def get_territory_name(lang_code):
country_name = None
locale = get_locale(lang_code)
try:
- country_name = locale.get_territory_name()
+ if locale is not None:
+ country_name = locale.get_territory_name()
except FileNotFoundError as exc:
print("ERROR: %s --> %s" % (locale, exc))
return country_name
@@ -190,7 +191,7 @@ def join_language_lists(engines_languages):
# Filter language list so it only includes the most supported languages and countries
def filter_language_list(all_languages):
- min_engines_per_lang = 13
+ min_engines_per_lang = 12
min_engines_per_country = 7
# pylint: disable=consider-using-dict-items, consider-iterating-dictionary
main_engines = [