aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/app.py
diff options
context:
space:
mode:
authorSebastian Spaeth <Sebastian@SSpaeth.de>2012-12-02 00:29:30 +0100
committerSebastian Spaeth <Sebastian@SSpaeth.de>2012-12-02 00:29:30 +0100
commit6ef75af50ecd9b71a5d9455f616c421b1d84b732 (patch)
tree2b58b181f1ba6937489c6d51f9ef39500a92cd02 /mediagoblin/app.py
parent7b9f9d1edb96aabab7e35818824b71efbdd4efb9 (diff)
downloadmediagoblin-6ef75af50ecd9b71a5d9455f616c421b1d84b732.tar.lz
mediagoblin-6ef75af50ecd9b71a5d9455f616c421b1d84b732.tar.xz
mediagoblin-6ef75af50ecd9b71a5d9455f616c421b1d84b732.zip
Honor user's browser language (#558)
Previously we would attempt to satisfy the user's first language preference, immediately falling back to english if that was not possible. Now, we will get the best match of the user's preferred languages. This requires storing the available locales on app startup, so we have mg_globals.available_locales ready to compare them against the list of preferred user languages. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Diffstat (limited to 'mediagoblin/app.py')
-rw-r--r--mediagoblin/app.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/mediagoblin/app.py b/mediagoblin/app.py
index de421aca..876ded4e 100644
--- a/mediagoblin/app.py
+++ b/mediagoblin/app.py
@@ -31,7 +31,7 @@ from mediagoblin.mg_globals import setup_globals
from mediagoblin.init.celery import setup_celery_from_config
from mediagoblin.init.plugins import setup_plugins
from mediagoblin.init import (get_jinja_loader, get_staticdirector,
- setup_global_and_app_config, setup_workbench, setup_database,
+ setup_global_and_app_config, setup_locales, setup_workbench, setup_database,
setup_storage, setup_beaker_cache)
from mediagoblin.tools.pluginapi import PluginManager
@@ -68,6 +68,9 @@ class MediaGoblinApp(object):
# Setup other connections / useful objects
##########################################
+ # load all available locales
+ setup_locales()
+
# Set up plugins -- need to do this early so that plugins can
# affect startup.
_log.info("Setting up plugins.")