First time here? Check out the FAQ!

Revision history  [back]

Okay, this isn't an answer, this is a continuation of the above comments, but I need room to post code :)

Here's my code, at the end of loaders.py:

def render_text(text, data, request):
    env = Environment(extensions=['jinja2.ext.i18n'])
    template = env.from_string(text)
    context = RequestContext(request, data)
    return shortcuts.render_to_string(template, context)

and it returns an error:

dictionary update sequence element #0 has length 1; 2 is required

Okay, this isn't an answer, this is a continuation of the above comments, but I need room to post code :)

Here's my code, at the end of loaders.py:

def render_text(text, data, request): env = Environment(extensions=['jinja2.ext.i18n']) template = env.from_string(text) context = RequestContext(request, data) return shortcuts.render_to_string(template, context)

context)

and it returns an error:

dictionary update sequence element #0 has length 1; 2 is required

Okay, this isn't an answer, this is a continuation of the above comments, but I need room to post code :)

Here's my code, at the end of loaders.py:

def render_text(text, data, request):
    env = Environment(extensions=['jinja2.ext.i18n'])
SkinEnvironment(extensions=['jinja2.ext.i18n'])
    template = env.from_string(text)
env.from_string(text) 
    context = RequestContext(request, data)
    return shortcuts.render_to_string(template, context)

data, context)

and it returns an error:It works just like if I was using the django Template:

dictionary update sequence element #0 has length 1; 2 is required
def render_text(text, data, request):
        context = RequestContext(request, data)
        template = Template(text)
        return template.render(context)

that is to say, it imports settings fine, but still doesn't allow for {% trans %} tags.