diff options
author | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2016-04-09 14:07:38 +0200 |
---|---|---|
committer | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2016-04-09 14:07:38 +0200 |
commit | a0203dc2aae6bd36dd980832b6ffbfdf75b5c936 (patch) | |
tree | c7a7493dedd3efcf4598d11d3c1911da19aa1f9d /src/web/views | |
parent | Add a link to the list of categories. (diff) | |
download | newspipe-a0203dc2aae6bd36dd980832b6ffbfdf75b5c936.tar.gz newspipe-a0203dc2aae6bd36dd980832b6ffbfdf75b5c936.tar.bz2 newspipe-a0203dc2aae6bd36dd980832b6ffbfdf75b5c936.zip |
Updated translations.
Diffstat (limited to 'src/web/views')
-rw-r--r-- | src/web/views/__init__.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/web/views/__init__.py b/src/web/views/__init__.py index c5903d9b..6de83818 100644 --- a/src/web/views/__init__.py +++ b/src/web/views/__init__.py @@ -10,3 +10,11 @@ __all__ = ['views', 'home', 'session_mgmt', 'api', 'article_bp', 'articles_bp', 'feed_bp', 'feeds_bp', 'category_bp', 'categories_bp', 'icon_bp', 'admin_bp', 'user_bp', 'users_bp'] + +import conf +from flask import request +from flask import g + +@g.babel.localeselector +def get_locale(): + return request.accept_languages.best_match(conf.LANGUAGES.keys()) |