aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/mg_globals.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/mg_globals.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/mg_globals.py')
-rw-r--r--mediagoblin/mg_globals.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/mediagoblin/mg_globals.py b/mediagoblin/mg_globals.py
index 356a944d..646fbdbd 100644
--- a/mediagoblin/mg_globals.py
+++ b/mediagoblin/mg_globals.py
@@ -45,6 +45,8 @@ workbench_manager = None
# A thread-local scope
thread_scope = threading.local()
+# a list of translated locales
+available_locales = None
# gettext (this will be populated on demand with gettext.Translations)
thread_scope.translations = None