Hi,

using the T() class in IS_IN_SET yields a strange result:
In this environment *T* does not depend on the language choosen by T.force
but *depends only on the language used in the setup of the browser.*
Tested with Google Chrome, Safari

Here are some lines of code to verify:

This is my database model:

db.define_table('my_table',
    Field('answer',
        requires=IS_IN_SET([('Y',*T('Yes')*), ('N',*T('No')*)]),
        widget=SQLFORM.widgets.checkboxes.widget,
        default='N',
        comment=T('Yes'),
        ),
    )

The controller:

def a():
    *T.force('de-de')*
    form=SQLFORM(db.my_table, submit_button=T('Submit'))
    if form.accepts(request.vars, session):
        response.flash='accepted'
    return dict(form=form, yes=T('Yes'), no=T('No'), submit=T('Submit'))

And the view:

{{extend 'layout.html'}}
{{=yes}} {{=no}} {{=submit}}<br />
{{=form}}


Of course there are also some language files with translations for "Yes",
"No" and "Submit".
The language choosen in T.force changes the whole website, *but does not
change the words "Yes" and "No" at the right side of the checkboxes*.

Regards. Martin

Reply via email to