diff options
| author | Alexis Metaireau <alexis@notmyidea.org> | 2011-10-17 00:03:41 +0200 |
|---|---|---|
| committer | Alexis Metaireau <alexis@notmyidea.org> | 2011-10-17 00:03:41 +0200 |
| commit | db7e1496b0af8f6270b8304055f2aabb2428fbe0 (patch) | |
| tree | 27e3abb27642a3b5bb341316de4a7fa77599f88d /budget/run.py | |
| parent | f7a969240a984c6eb63662331ad7767283088efc (diff) | |
| download | ihatemoney-mirror-db7e1496b0af8f6270b8304055f2aabb2428fbe0.zip ihatemoney-mirror-db7e1496b0af8f6270b8304055f2aabb2428fbe0.tar.gz ihatemoney-mirror-db7e1496b0af8f6270b8304055f2aabb2428fbe0.tar.bz2 | |
Add the ability to change the language explicitely. I'm not sure the UI is better with this. Any thoughts are welcome. Fix #35
Diffstat (limited to 'budget/run.py')
| -rw-r--r-- | budget/run.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/budget/run.py b/budget/run.py index ebcf45e..3d57329 100644 --- a/budget/run.py +++ b/budget/run.py @@ -24,7 +24,9 @@ babel = Babel(app) @babel.localeselector def get_locale(): - lang = request.accept_languages.best_match(['fr', 'en']) + # 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'])) setattr(g, 'lang', lang) return lang |
