To me it does not make sense to ask for dynamic translations of values
in the database.
You can translate dropdowns using IS_IN_SET since its values are
constant:
IN_IN_SET(('key1','key2'),(T('value1'),T('value2')))
Massimo
On Jul 23, 9:00 am, Fran <[email protected]> wrote:
> In order to be able to support Internationalisation of formfield
> dropdown options, what do we need to do?
>
> In the manual it says:
> "If the string to be translated is not a constant but a variable, it
> will be added to the translation file at runtime to be translated
> later."
>
> I tried to get this working by setting up an options table for an
> IS_IN_DB() dropdown.
> This kind of structure doesn't work:
> db.table.group_type.widget = lambda f, v: OptionsWidget.widget(f, T
> (v))
>
> I therefore tried to have another place which called the various
> options:
> def test():
> table.group_type.name.represent = lambda name: T(name)
> items = crud.select(table.group_type)
> return dict(items=items)
>
> I ran this function & got my table output, I then hit 'update all
> languages' & went to my test languages file, but these strings hadn't
> appeared inside.
>
> Anybody got this working or can work out how to?
>
> Many thanks,
> Fran.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---