Semantics of the tg.i18n.setup_i18n() function

1 view
Skip to first unread message

Timur Izhbulatov

unread,
Jun 12, 2009, 5:58:16 AM6/12/09
to turbogea...@googlegroups.com
Hi all,

I've been porting my app to 2.0 and noticed that setup_i18n() [1]
doesn't set FormEncode translation if it finds language in session.
This function is the only i18n API that the controller is aware of and
it's called internally, so there's no way to change this without
overriding controller methods.

That is, currently FormEncode translation is only set when there's an
Accept-Language match. Shouldn't setup_i18n() also set FormEncode
translation if there's language in session?

[1] http://trac.turbogears.org/browser/trunk/tg/i18n.py?rev=6489#L11

--
Timur Izhbulatov — www.timka.org

Jorge Vargas

unread,
Jun 13, 2009, 1:55:46 AM6/13/09
to turbogea...@googlegroups.com
On Fri, Jun 12, 2009 at 5:58 AM, Timur Izhbulatov<timo...@gmail.com> wrote:
>
> Hi all,
>
> I've been porting my app to 2.0 and noticed that setup_i18n() [1]
> doesn't set FormEncode translation if it finds language in session.
> This function is the only i18n API that the controller is aware of and
> it's called internally, so there's no way to change this without
> overriding controller methods.
>
> That is, currently FormEncode translation is only set when there's an
> Accept-Language match. Shouldn't setup_i18n() also set FormEncode
> translation if there's language in session?
>
yes I think it should.

Timur Izhbulatov

unread,
Jun 13, 2009, 12:59:02 PM6/13/09
to turbogea...@googlegroups.com
2009/6/13 Jorge Vargas <jorge....@gmail.com>:

>
> On Fri, Jun 12, 2009 at 5:58 AM, Timur Izhbulatov<timo...@gmail.com> wrote:
>>
>> Hi all,
>>
>> I've been porting my app to 2.0 and noticed that setup_i18n() [1]
>> doesn't set FormEncode translation if it finds language in session.
>> This function is the only i18n API that the controller is aware of and
>> it's called internally, so there's no way to change this without
>> overriding controller methods.
>>
>> That is, currently FormEncode translation is only set when there's an
>> Accept-Language match. Shouldn't setup_i18n() also set FormEncode
>> translation if there's language in session?
>>
> yes I think it should.

OK. Here's a ticket for this http://trac.turbogears.org/ticket/2335

There's also a patch.

--
Timur Izhbulatov — www.timka.org

Mark Ramm

unread,
Jun 19, 2009, 11:57:13 PM6/19/09
to turbogea...@googlegroups.com
Thanks.   

I just had to do 2.0.1 very quickly today, but I think we should get this integrated in as soon as we can and do a 2.0.2 release this week too. 

--Mark Ramm
--
Mark Ramm-Christensen
email: mark at compoundthinking dot com
blog: www.compoundthinking.com/blog

Timur Izhbulatov

unread,
Jun 20, 2009, 3:59:51 AM6/20/09
to turbogea...@googlegroups.com
2009/6/20 Mark Ramm <mark.mch...@gmail.com>:
> Thanks.
> I just had to do 2.0.1 very quickly today, but I think we should get this
> integrated in as soon as we can and do a 2.0.2 release this week too.

Very good. I changed the ticket's milestone to 2.* bugfix, which seems
appropriate.

> --Mark Ramm
> On Sat, Jun 13, 2009 at 12:59 PM, Timur Izhbulatov <timo...@gmail.com>
> wrote:
>>
>> 2009/6/13 Jorge Vargas <jorge....@gmail.com>:
>> >
>> > On Fri, Jun 12, 2009 at 5:58 AM, Timur Izhbulatov<timo...@gmail.com>
>> > wrote:
>> >>
>> >> Hi all,
>> >>
>> >> I've been porting my app to 2.0 and noticed that setup_i18n() [1]
>> >> doesn't set FormEncode translation if it finds language in session.
>> >> This function is the only i18n API that the controller is aware of and
>> >> it's called internally, so there's no way to change this without
>> >> overriding controller methods.
>> >>
>> >> That is, currently FormEncode translation is only set when there's an
>> >> Accept-Language match. Shouldn't setup_i18n() also set FormEncode
>> >> translation if there's language in session?
>> >>
>> > yes I think it should.
>>
>> OK. Here's a ticket for this http://trac.turbogears.org/ticket/2335
>>
>> There's also a patch.
>>
>> --
>> Timur Izhbulatov — www.timka.org
>>
>>
>
>
>
> --
> Mark Ramm-Christensen
> email: mark at compoundthinking dot com
> blog: www.compoundthinking.com/blog
>
>
> >
>



--
Timur Izhbulatov — www.timka.org

Jorge Vargas

unread,
Jun 20, 2009, 12:42:25 PM6/20/09
to turbogea...@googlegroups.com
On Sat, Jun 20, 2009 at 3:59 AM, Timur Izhbulatov<timo...@gmail.com> wrote:
>
> 2009/6/20 Mark Ramm <mark.mch...@gmail.com>:
>> Thanks.
>> I just had to do 2.0.1 very quickly today, but I think we should get this
>> integrated in as soon as we can and do a 2.0.2 release this week too.
>
> Very good. I changed the ticket's milestone to 2.* bugfix, which seems
> appropriate.
>
yes indeed I created that last night :)
Reply all
Reply to author
Forward
0 new messages