Changes between Version 2 and Version 3 of DeveloperGuidelines/Internationalisation


Ignore:
Timestamp:
07/29/09 00:16:25 (16 years ago)
Author:
Fran Boon
Comment:

Full Dropdowns pattern (inc re-accessible lookup & represent)

Legend:

Unmodified
Added
Removed
Modified
  • DeveloperGuidelines/Internationalisation

    v2 v3  
    1212To make dropdown options localisable, use this pattern:
    1313{{{
    14 db[table][field].requires = IS_IN_SET({'1':T('Option1'), '2':T('Option2')})
     14table_field_opts = {'1':T('Option1'), '2':T('Option2')}
     15db[table][field].requires = IS_IN_SET(table_field_opts)
     16db[table][field].represent = lambda opt: table_field_opts[opt]
    1517}}}
    1618