mirror of
https://github.com/searxng/searxng.git
synced 2025-07-23 13:19:17 +02:00
Bump flask-babel from 2.0.0 to 3.0.0
Bumps [flask-babel](https://github.com/python-babel/flask-babel) from 2.0.0 to 3.0.0. - [Release notes](https://github.com/python-babel/flask-babel/releases) - [Changelog](https://github.com/python-babel/flask-babel/blob/master/CHANGELOG) - [Commits](https://github.com/python-babel/flask-babel/compare/v2.0.0...v3.0.0) --- updated-dependencies: - dependency-name: flask-babel dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
parent
eed9b09d98
commit
70fff2ebf1
3 changed files with 5 additions and 5 deletions
|
@ -160,8 +160,6 @@ app.jinja_env.add_extension('jinja2.ext.loopcontrols') # pylint: disable=no-mem
|
|||
app.jinja_env.filters['group_engines_in_tab'] = group_engines_in_tab # pylint: disable=no-member
|
||||
app.secret_key = settings['server']['secret_key']
|
||||
|
||||
babel = Babel(app)
|
||||
|
||||
timeout_text = gettext('timeout')
|
||||
parsing_error_text = gettext('parsing error')
|
||||
http_protocol_error_text = gettext('HTTP protocol error')
|
||||
|
@ -211,13 +209,15 @@ class ExtendedRequest(flask.Request):
|
|||
request = typing.cast(ExtendedRequest, flask.request)
|
||||
|
||||
|
||||
@babel.localeselector
|
||||
def get_locale():
|
||||
locale = localeselector()
|
||||
logger.debug("%s uses locale `%s`", urllib.parse.quote(request.url), locale)
|
||||
return locale
|
||||
|
||||
|
||||
babel = Babel(app, locale_selector=get_locale)
|
||||
|
||||
|
||||
def _get_browser_language(req, lang_list):
|
||||
for lang in req.headers.get("Accept-Language", "en").split(","):
|
||||
if ';' in lang:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue