summaryrefslogtreecommitdiff
path: root/searx/locales.py
diff options
context:
space:
mode:
authorAlexandre Flament <alex@al-f.net>2022-07-08 10:00:20 +0200
committerAlexandre Flament <alex@al-f.net>2022-07-08 10:00:20 +0200
commitf90aed7ef9902a54d9dbb8ab5c739915ec6243dd (patch)
tree85ce2bc3b2fa3b2d2deee6d6e6096700900268de /searx/locales.py
parentcb3a31c04dc1ede588807b5de31b42fd4f85d653 (diff)
downloadsearxng-f90aed7ef9902a54d9dbb8ab5c739915ec6243dd.tar.gz
searxng-f90aed7ef9902a54d9dbb8ab5c739915ec6243dd.zip
locales.py: add support for Papiamento
Diffstat (limited to 'searx/locales.py')
-rw-r--r--searx/locales.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/searx/locales.py b/searx/locales.py
index f96ae5c05..3deff6863 100644
--- a/searx/locales.py
+++ b/searx/locales.py
@@ -32,6 +32,7 @@ RTL_LOCALES: Set[str] = set()
ADDITIONAL_TRANSLATIONS = {
"oc": "Occitan",
"szl": "Ślōnski (Silesian)",
+ "pap": "Papiamento",
}
"""Additional languages SearXNG has translations for but not supported by
python-babel (see :py:obj:`locales_initialize`)."""
@@ -41,6 +42,7 @@ LOCALE_BEST_MATCH = {
"szl": "pl",
"nl-BE": "nl",
"zh-HK": "zh-Hant-TW",
+ "pap": "pt-BR",
}
"""Map a locale we do not have a translations for to a locale we have a
translation for. By example: use Taiwan version of the translation for Hong
@@ -79,6 +81,9 @@ def get_translations():
if has_request_context() and flask.request.form.get('use-translation') == 'szl':
babel_ext = flask_babel.current_app.extensions['babel']
return Translations.load(next(babel_ext.translation_directories), 'szl')
+ if has_request_context() and flask.request.form.get('use-translation') == 'pap':
+ babel_ext = flask_babel.current_app.extensions['babel']
+ return Translations.load(next(babel_ext.translation_directories), 'pap')
return _flask_babel_get_translations()