Changes between Version 3 and Version 4 of DeveloperGuidelines/Internationalisation


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

Integers not Strings

Legend:

Unmodified
Added
Removed
Modified
  • DeveloperGuidelines/Internationalisation

    v3 v4  
    1212To make dropdown options localisable, use this pattern:
    1313{{{
    14 table_field_opts = {'1':T('Option1'), '2':T('Option2')}
     14db.define_table(table,
     15                Field('category_type', 'integer', notnull=True),
     16                ...
     17                )
     18table_field_opts = {1:T('Option1'), 2:T('Option2')}
    1519db[table][field].requires = IS_IN_SET(table_field_opts)
    1620db[table][field].represent = lambda opt: table_field_opts[opt]