コード例 #1
0
ファイル: __init__.py プロジェクト: bhrigu123/moin-2.0-beta
def i18n_init(app):
    """ initialize Flask-Babel """
    babel = Babel(app)
    babel.localeselector(get_locale)
    babel.timezoneselector(get_timezone)
コード例 #2
0
ファイル: __init__.py プロジェクト: ktmud/david
def init_babel(app):
    babel = Babel(app)
    babel.timezoneselector(_get_timezone)
    app.before_request(_set_context_locale)
コード例 #3
0
ファイル: __init__.py プロジェクト: denedios/moin-2.0
def i18n_init(app):
    """ initialize Flask-Babel """
    babel = Babel(app)
    babel.localeselector(get_locale)
    babel.timezoneselector(get_timezone)
コード例 #4
0
ファイル: test_filters.py プロジェクト: mmariani/abilian-core
 def create_app(self):
   app = Flask(__name__)
   babel = Babel(app, default_locale='fr', default_timezone=USER_TZ)
   babel.localeselector(en_locale)
   babel.timezoneselector(user_tz)
   return app