Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
Markus Heiser
2022-08-24 18:57:36 +02:00
parent 744d96a16c
commit a5580c785d
13 changed files with 4555 additions and 4428 deletions

View File

@@ -19,13 +19,14 @@ from searx import logger
logger = logger.getChild('locales')
LANGUAGES_FILE = pathlib.Path(__file__).parent / 'languages.py'
# safe before monkey patching flask_babel.get_translations
_flask_babel_get_translations = flask_babel.get_translations
LOCALE_NAMES = {}
"""Mapping of locales and their description. Locales e.g. 'fr' or 'pt-BR' (see
:py:obj:`locales_initialize`)."""
"""Mapping of locales and their description. Locales e.g. ``fr`` or ``pt-BR``
(see :py:obj:`locales_initialize`)."""
RTL_LOCALES: Set[str] = set()
"""List of *Right-To-Left* locales e.g. 'he' or 'fa-IR' (see
@@ -161,6 +162,8 @@ def get_engine_locale(searxng_locale, engine_locales, default=None):
Argument ``engine_locales`` is a python dict that maps *SearXNG locales* to
corresponding *engine locales*:
.. code:: python
<engine>: {
# SearXNG string : engine-string
'ca-ES' : 'ca_ES',