Skip to content

Commit

Permalink
config for locale support
Browse files Browse the repository at this point in the history
  • Loading branch information
lepture committed Aug 10, 2012
1 parent 5cbb74e commit 04127f7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions june/_config/development.py
Expand Up @@ -14,3 +14,4 @@

# babel settings
BABEL_DEFAULT_LOCALE = 'zh'
BABEL_SUPPORTED_LOCALES = ['zh']
6 changes: 4 additions & 2 deletions june/app.py
Expand Up @@ -32,8 +32,10 @@ def load_current_user():

@babel.localeselector
def get_locale():
#return request.accept_languages.best_match(['en', 'zh'])
return 'zh'
app.config.setdefault('BABEL_SUPPORTED_LOCALES', ['en', 'zh'])
match = app.config['BABEL_SUPPORTED_LOCALES']
default = app.config['BABEL_DEFAULT_LOCALE']
return request.accept_languages.best_match(match, default)


def register(blueprint):
Expand Down

0 comments on commit 04127f7

Please sign in to comment.