aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/globals.py
diff options
context:
space:
mode:
authorChristopher Allan Webber <cwebber@dustycloud.org>2011-05-12 22:33:30 -0500
committerChristopher Allan Webber <cwebber@dustycloud.org>2011-05-12 22:33:30 -0500
commitb77eec653df14059296fc3185ff9817edfa0825b (patch)
treeedd3332c6b32a1fc7b37d15f0df7ed0a67ee7c95 /mediagoblin/globals.py
parente461b7771300ab75777b01f4732fdcbc358064f7 (diff)
downloadmediagoblin-b77eec653df14059296fc3185ff9817edfa0825b.tar.lz
mediagoblin-b77eec653df14059296fc3185ff9817edfa0825b.tar.xz
mediagoblin-b77eec653df14059296fc3185ff9817edfa0825b.zip
Load gettext, and load it into the template environment
Diffstat (limited to 'mediagoblin/globals.py')
-rw-r--r--mediagoblin/globals.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/mediagoblin/globals.py b/mediagoblin/globals.py
index 59a94558..80d1f01d 100644
--- a/mediagoblin/globals.py
+++ b/mediagoblin/globals.py
@@ -2,6 +2,9 @@
In some places, we need to access the database, public_store, queue_store
"""
+import gettext
+import pkg_resources
+
#############################
# General mediagoblin globals
#############################
@@ -16,6 +19,12 @@ database = None
public_store = None
queue_store = None
+# gettext
+translations = gettext.find(
+ 'mediagoblin',
+ pkg_resources.resource_filename(
+ 'mediagoblin', 'translations'), ['en'])
+
def setup_globals(**kwargs):
from mediagoblin import globals as mg_globals