searxngRebrandZaclys/searx
Markus Heiser ad964562ce [fix] move locale code from webapp.py to locales.py and fix #1303
To improve modularization this patch:

- moves *locale* related implementation from the webapp.py application to the
  locale.py module.

- The initialization of the locales is now done in the application (webapp) and
  is no longer done while importing searx.locales.

In the searx.locales module a new dictionary named `LOCALE_BEST_MATCH` has been
added.  In this dictionary we can map languages without a translation to
languages we have a translation for.

To fix #1303 zh-HK has been mapped to zh-Hant-TW (we do not need additional
translations of traditional Chinese)

Closes: https://github.com/searxng/searxng/issues/1303
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-06-12 10:52:26 +02:00
..
answerers [fix] issue reported by pylint 22.1.0 2022-02-04 09:45:35 +01:00
data Merge pull request #1266 from searxng/update_data_update_firefox_version.py 2022-06-01 13:49:48 +02:00
engines [fix] prepare for pylint 2.14.0 2022-06-03 15:41:52 +02:00
infopage [fix] prepare for pylint 2.14.0 2022-06-03 15:41:52 +02:00
metrics [fix] prepare for pylint 2.14.0 2022-06-03 15:41:52 +02:00
network [fix] prepare for pylint 2.14.0 2022-06-03 15:41:52 +02:00
plugins Merge pull request #1047 from return42/redis-lib 2022-06-06 10:59:11 +02:00
search [fix] prepare for pylint 2.14.0 2022-06-03 15:41:52 +02:00
shared [pyright:strict] searx.search.checker.background 2022-01-27 22:07:12 +01:00
static [build] /static 2022-06-05 23:06:19 +02:00
templates/simple Revert "Theme: add a preference to center the results (Oscar)" 2022-06-05 23:03:26 +02:00
translations [translations] update from Weblate 2022-06-10 07:19:19 +00:00
__init__.py [format.python] initial formatting of the python code 2021-12-27 09:26:22 +01:00
autocomplete.py [format.python] based on bugfix in 9ed626130 2022-05-07 18:23:10 +02: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] add module for backward compatibility 2022-03-12 15:45:28 +01:00
exceptions.py [pyright:strict] searx.search.checker.background 2022-01-27 22:07:12 +01:00
external_bang.py [fix] external bangs: don't overwrite Bangs in data trie 2022-01-12 19:37:13 +01:00
external_urls.py [format.python] initial formatting of the python code 2021-12-27 09:26:22 +01:00
flaskfix.py [format.python] initial formatting of the python code 2021-12-27 09:26:22 +01:00
languages.py [fix] add back missing languages & regions (followup of PR #1071) 2022-04-22 12:09:42 +02:00
locales.py [fix] move locale code from webapp.py to locales.py and fix #1303 2022-06-12 10:52:26 +02:00
preferences.py Revert "Theme: add a preference to center the results (Oscar)" 2022-06-05 23:03:26 +02:00
query.py [mod] add flags to the languages filter 2022-03-19 15:09:13 +01:00
redislib.py [mod] redislib - optimize LUA script registration. 2022-05-30 11:21:09 +02:00
results.py [simple theme] replace Image_layout.js with flexbox CS impl. 2022-02-26 22:31:47 +01:00
searxng.msg [mod] move category and names of constants to searx/searxng.msg 2022-03-16 09:55:53 +01:00
settings_defaults.py Revert "Theme: add a preference to center the results (Oscar)" 2022-06-05 23:03:26 +02:00
settings_loader.py [format.python] initial formatting of the python code 2021-12-27 09:26:22 +01:00
settings.yml Fixed typo in settings.yml 2022-06-09 17:08:14 +02:00
unixthreadname.py [format.python] initial formatting of the python code 2021-12-27 09:26:22 +01:00
utils.py [fix] prepare for pylint 2.14.0 2022-06-03 15:41:52 +02:00
version.py [fix] version.py: git format '%cs' is not downward compatible 2022-06-04 09:15:26 +02:00
webadapter.py [fix] disabling all engines in a category makes the bang search in general 2022-01-03 20:23:46 +01:00
webapp.py [fix] move locale code from webapp.py to locales.py and fix #1303 2022-06-12 10:52:26 +02:00
webutils.py theme: remove __common__ 2022-05-07 19:40:48 +02:00