Skip to content

Commit

Permalink
Update Babel package
Browse files Browse the repository at this point in the history
Upgrade the Babel package to version ^2.12 in response to the Python
version upgrade. Fixes #483.
  • Loading branch information
kvchitrapu authored Apr 2, 2023
1 parent b0c479f commit 5c83907
Show file tree
Hide file tree
Showing 4 changed files with 1,609 additions and 1,527 deletions.
10 changes: 5 additions & 5 deletions ambuda/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
import logging
import sys

import config
import sentry_sdk
from dotenv import load_dotenv
from flask import Flask, session
from flask_babel import Babel, pgettext
from sentry_sdk.integrations.flask import FlaskIntegration
from sqlalchemy import exc

import config
from ambuda import admin as admin_manager
from ambuda import auth as auth_manager
from ambuda import checks, filters, queries
Expand Down Expand Up @@ -111,13 +111,13 @@ def create_app(config_env: str):
# Database
_initialize_db_session(app, config_env)

# Extensions
babel = Babel(app)

@babel.localeselector
# A custom Babel locale_selector.
def get_locale():
return session.get("locale", config_spec.BABEL_DEFAULT_LOCALE)

# Extensions
Babel(app, locale_selector=get_locale)

login_manager = auth_manager.create_login_manager()
login_manager.init_app(app)

Expand Down
Loading

0 comments on commit 5c83907

Please sign in to comment.