Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update Babel package #486

Merged
merged 5 commits into from
Apr 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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