Commit Graph

17 Commits (ad964562ce249f86b806638d1eab2afc2c4ed8df)

Author SHA1 Message Date
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>
2 years ago
Markus Heiser e8541b6006 [theme] peel out oscar from SearXNG development
This is the first step of removing oscar theme

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2 years ago
Markus Heiser fdeece0aae [fix] changeover of the unit tests to the simple theme
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2 years ago
Martin Fischer 180d4d068b [refactor] refactor SwitchableSetting
The previous implementation used two hash sets and a list.
... that's not necessary ... a single hash map suffices.

And it's also less error prone ... because the previous data structure
allowed a setting to be enabled and disabled at the same time.
2 years ago
Martin Fischer bb06758a7b [refactor] add type hints & remove Setting._post_init
Previously the Setting classes used a horrible _post_init
hack that prevented proper type checking.
2 years ago
Markus Heiser 3d96a9839a [format.python] initial formatting of the python code
This patch was generated by black [1]::

    make format.python

[1] https://github.com/psf/black

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Alexandre Flament b9c73fb697 [mod] move searx/testing.py to the tests directory
move robot tests to tests.robot
manage calls "python -m tests.robot"
3 years ago
Alexandre Flament b00d108673 [mod] pylint: numerous minor code fixes 4 years ago
Noémi Ványi 33e139cae6 Let admins lock user preferences 4 years ago
Dalf 7888377743 Drop Python 2 (3/n): objects 4 years ago
Dalf 1022228d95 Drop Python 2 (1/n): remove unicode string and url_utils 4 years ago
rachmadani haryono 8f44014627 [fix] preference query parameter decoding (#1599)
Fix issue #1598
5 years ago
Noémi Ványi b63d645a52 Revert "remove 'all' option from search languages"
This reverts commit 4d1770398a.
6 years ago
marc 4d1770398a remove 'all' option from search languages 7 years ago
marc e0c270bd72 tests for language support in engines 8 years ago
stepshal cd9b494cb5 Fix quantity of blank lines after code object. 8 years ago
Noemi Vanyi f0fd9ad628 add unit && robot tests 8 years ago