diff options
| author | Brice Maron <b.maron@whatever-company.com> | 2019-07-29 22:10:58 +0200 |
|---|---|---|
| committer | Alexis Metaireau <alexis@notmyidea.org> | 2019-08-18 21:37:20 +0000 |
| commit | fd49599cc76de69e81f645257845778571d4d964 (patch) | |
| tree | df2e05f35fd1ce1894651e96f59a769917d3b0fb /ihatemoney/run.py | |
| parent | b5cc1592d6907ea055757a37389c6bfada142ec9 (diff) | |
| download | ihatemoney-mirror-fd49599cc76de69e81f645257845778571d4d964.zip ihatemoney-mirror-fd49599cc76de69e81f645257845778571d4d964.tar.gz ihatemoney-mirror-fd49599cc76de69e81f645257845778571d4d964.tar.bz2 | |
Arrange navbar items by functions
Diffstat (limited to 'ihatemoney/run.py')
| -rw-r--r-- | ihatemoney/run.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/ihatemoney/run.py b/ihatemoney/run.py index e9b3ce1..41598ce 100644 --- a/ihatemoney/run.py +++ b/ihatemoney/run.py @@ -10,7 +10,8 @@ from werkzeug.contrib.fixers import ProxyFix from ihatemoney.api import api from ihatemoney.models import db -from ihatemoney.utils import PrefixedWSGI, minimal_round, IhmJSONEncoder +from ihatemoney.utils import (IhmJSONEncoder, PrefixedWSGI, locale_from_iso, + minimal_round, static_include) from ihatemoney.web import main as web_interface from ihatemoney import default_settings @@ -135,6 +136,8 @@ def create_app(configuration=None, instance_path='/etc/ihatemoney', app.mail = mail # Jinja filters + app.jinja_env.globals['static_include'] = static_include + app.jinja_env.globals['locale_from_iso'] = locale_from_iso app.jinja_env.filters['minimal_round'] = minimal_round # Translations @@ -144,7 +147,10 @@ def create_app(configuration=None, instance_path='/etc/ihatemoney', def get_locale(): # get the lang from the session if defined, fallback on the browser "accept # languages" header. - lang = session.get('lang', request.accept_languages.best_match(['fr', 'en'])) + lang = session.get( + 'lang', + request.accept_languages.best_match(app.config['SUPPORTED_LANGUAGES']) + ) setattr(g, 'lang', lang) return lang |
