My view looks like:
{{extend 'layout.html'}}
<br>
{{=T('Sellers in this campaign')}}<br>
<table>{{for person in person_data:}}
<tr><td>
{{=A(str(person.name + " " + person.surname),
_href=URL(r=request, f='edit_seller', args=[troop.id, person.id,
person.troop_group]))}}
</td><td>{{=groups[person.troop_group]['name']}}
</tr>
{{pass}}
</table>
<br>{{=T('Insert old user to this campaign')}}<br>
{{=form}}
<br><br>{{=form_new_person}}
<br><br><br>
{{=T('Troop groups')}}<br>
<table>{{for group in group_data:}}
<tr><td>{{=A(group.name, _href=URL(r=request, f='edit_group',
args=[troop.id, campaign.id, group.id]))}}
</td></tr>
{{pass}}
</table>
<br>
{{=form_new_group}}
Controller:
form = SQLFORM.factory(Field('new_seller',
requires=IS_IN_SET(['kalle','ville'])), label=str(T('New seller')), **args)
form['_formname'] = 'add_seller'
I changed the IS_IS_DB to IS_IN_SET but that didn´t help either.
What part of the view do I need to look at.
Kenneth
This must work. Can you please post your model and view?
On Aug 19, 5:51 am, Kenneth Lundström<[email protected]>
wrote:
Intresting, it doesn t work.
If I use just label=T('Add seller') it doesn t even translate (doesn t
appear in my language file)
when I tried with label=str(T('Add seller')) the string is translate but
not shown.
Kenneth
Try label=str(T('Add seller'))
On Aug 19, 6:33 am, Kenneth Lundstr m<[email protected]>
wrote:
Of course, thats a very much easier way of doing. But it doesn t work
either. It doesn t get translated.
Kenneth
Hi Kenneth,
if you don't need the custom form then you can just use the label
parameter on the Field,
Field('new_seller', ..., label=T('Add seller'))
Denes.
On Aug 19, 12:28 am, Kenneth<[email protected]> wrote:
I create my form with
args = {}
args['submit_button'] = T('Insert person')
form = SQLFORM.factory(Field('new_seller', 'integer',
requires=IS_IN_DB(.........), **args)
in my view I show it with
{{=form}}
and it looks like
New Seller: a dropdown list
it works nicely, but then I would like to translate the 'New Seller'
text and per online book it should work like:
{{=form.custom.begin}}
{{=T('Add seller')}}:<div>{{=form.custom.widget.add_seller}}</div>
{{=form.custom.end}}
The text is translated, but instead of the dropdown list I get the
text 'None', no dropdown.
Kenneth