[open-ils-commits] r1284 - servres/branches/i18n/conifer/plumbing (gfawcett)
svn at svn.open-ils.org
svn at svn.open-ils.org
Sun Mar 27 15:13:28 EDT 2011
Author: gfawcett
Date: 2011-03-27 15:13:24 -0400 (Sun, 27 Mar 2011)
New Revision: 1284
Modified:
servres/branches/i18n/conifer/plumbing/genshi_support.py
Log:
reactivate full Babel support in Genshi
Modified: servres/branches/i18n/conifer/plumbing/genshi_support.py
===================================================================
--- servres/branches/i18n/conifer/plumbing/genshi_support.py 2011-03-27 14:43:03 UTC (rev 1283)
+++ servres/branches/i18n/conifer/plumbing/genshi_support.py 2011-03-27 19:13:24 UTC (rev 1284)
@@ -1,11 +1,13 @@
import os
from django.http import HttpResponse, HttpRequest
from genshi.template import TemplateLoader
+from genshi.filters import Translator
from genshi.template import NewTextTemplate
from genshi.builder import tag
import genshi.output
from django.conf import settings
from warnings import warn
+from django.utils.translation import ugettext
try:
from threading import local
@@ -29,6 +31,9 @@
#---------------------------------------------------------------------------
# Templating support
+translator = Translator(ugettext)
+
+
class TemplateSet(object):
def __init__(self, basedir, namespace_module=None):
@@ -45,14 +50,13 @@
else:
self.namespace_module = namespace_module
-
def file(self, name):
fn = os.path.join(self.basedir, name)
assert os.path.dirname(fn) == self.basedir
return file(fn)
def template_loaded(self, template):
- pass
+ template.filters.insert(0, Translator(ugettext))
def template(self, tname):
return self.loader.load(tname)
More information about the open-ils-commits
mailing list