Hi django-users,

how can i force django to render a template in a specific language?

Consider this simple piece of code:

t = get_template('internationalized_template.html')
document = t.render(Context(locals()))

The code is taken from an application where I create PDF files (via  
pisa) for
all users of the site.

Most times the code is called through a script, sometimes through the  
django
admin, but never by the user himself.

Now I want to set language that the template will be rendered in - i  
just don't
see how to do it:

According to the documentation LocaleMiddleware is responsible to  
determine what
language should be used. When called through a script the middleware  
should not
be involved and my assumption is, that the dummy gettext functions are  
used.

What can I do to get django translate the template for me?

Thanks in advance,

Till Backhaus


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to