From 62982c8812c31249ab0cf3d0a8ca97eb439abf5e Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Fri, 22 Apr 2022 12:09:42 +0200 Subject: [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 --- searxng_extra/update/update_languages.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'searxng_extra/update') diff --git a/searxng_extra/update/update_languages.py b/searxng_extra/update/update_languages.py index 95ee5bd3e..5baf2fc5c 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 = [ -- cgit v1.2.3-54-g00ecf