Re: Internationalization problem in template system

2007-01-18 Thread Maxime Biais
Patrick J. Anderson wrote: class MyModel(models.Model): text_en = TextField() text_pt-br = TextField() Django complains with a SyntaxError: can't assign to operator on "text_pt-br = TextField()" line This just what I did in my models, but perhaps

Re: Internationalization problem in template system

2007-01-18 Thread Patrick J. Anderson
On Thu, 11 Jan 2007 16:58:34 -0600, Jacob Kaplan-Moss wrote: On 1/11/07 2:35 PM, Nuno Mariz wrote: Any idea to resolve this , this don't scale. If I what to add another language, I have to patch all of my templates. If I were you, I'd write a simple accessor on your model to get the current

Re: Internationalization problem in template system

2007-01-11 Thread Nuno Mariz
Jacob Kaplan-Moss wrote: > On 1/11/07 2:35 PM, Nuno Mariz wrote: >> Any idea to resolve this , this don't scale. If I what to add another >> language, I have to patch all of my templates. > > If I were you, I'd write a simple accessor on your model to get the current > translation. Off the

Re: Internationalization problem in template system

2007-01-11 Thread Jacob Kaplan-Moss
On 1/11/07 2:35 PM, Nuno Mariz wrote: > Any idea to resolve this , this don't scale. If I what to add another > language, I have to patch all of my templates. If I were you, I'd write a simple accessor on your model to get the current translation. Off the top of my head, you could do

Internationalization problem in template system

2007-01-11 Thread Nuno Mariz
I have a internationalization problem to solve in the template system. In my model: [...] text_pt = TextField() text_en = TextField() [...] In my template: {% load i18n %} {% get_current_language as LANGUAGE_CODE %} {% ifequal LANGUAGE_CODE 'en' %} {{ object.text_en }} {% else %} {{