summaryrefslogtreecommitdiff
path: root/searx
diff options
context:
space:
mode:
authorAlexandre FLAMENT <alexandre.flament@hesge.ch>2022-05-06 09:40:45 +0000
committerAlexandre FLAMENT <alexandre.flament@hesge.ch>2022-05-06 09:40:45 +0000
commit550f70b1aabd377ace73a011024eaa4ea13ffab4 (patch)
treecc7334f0d304a966689989f4c6ad4d3d83048326 /searx
parent12a584c5dd2ebac4ea33630479fcb87fe3e11497 (diff)
Add support for the Silesian language
Diffstat (limited to 'searx')
-rw-r--r--searx/locales.py1
-rwxr-xr-xsearx/webapp.py6
2 files changed, 7 insertions, 0 deletions
diff --git a/searx/locales.py b/searx/locales.py
index 62f64204f..677b13334 100644
--- a/searx/locales.py
+++ b/searx/locales.py
@@ -13,6 +13,7 @@ from babel import Locale
LOCALE_NAMES = {
"oc": "Occitan",
"nl-BE": "Vlaams (Dutch, Belgium)",
+ "szl": "Ślōnski (Silesian)",
}
"""Mapping of locales and their description. Locales e.g. 'fr' or 'pt-BR'
(delimiter is *underline* '-')"""
diff --git a/searx/webapp.py b/searx/webapp.py
index 648a49ebe..3d3f736a5 100755
--- a/searx/webapp.py
+++ b/searx/webapp.py
@@ -220,6 +220,9 @@ def _get_translations():
if has_request_context() and request.form.get('use-translation') == 'oc':
babel_ext = flask_babel.current_app.extensions['babel']
return Translations.load(next(babel_ext.translation_directories), 'oc')
+ if has_request_context() and request.form.get('use-translation') == 'szl':
+ babel_ext = flask_babel.current_app.extensions['babel']
+ return Translations.load(next(babel_ext.translation_directories), 'szl')
return _flask_babel_get_translations()
@@ -238,6 +241,9 @@ def get_locale():
if locale == 'oc':
request.form['use-translation'] = 'oc'
locale = 'fr_FR'
+ if locale == 'szl':
+ request.form['use-translation'] = 'szl'
+ locale = 'pl'
if locale == '':
# if there is an error loading the preferences
# the locale is going to be ''