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>
If there is no write access, there is no need for global. Remove global
statement if there is no assignment.
global-variable-not-assigned:
Using global for names but no assignment is done Used when a variable is
defined through the "global" statement but no assignment to this variable is
done.
In Pylint 2.11 the global-variable-not-assigned checker now catches global
variables that are never reassigned in a local scope and catches (reassigned)
functions [1][2]
[1] https://pylint.pycqa.org/en/latest/whatsnew/2.11.html
[2] https://github.com/PyCQA/pylint/issues/1375
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
- Add ``# lint: pylint`` header to pylint this python file.
- Fix issues reported by pylint.
- Add source code documentation of modul searx.locales
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>