Changes between Version 3 and Version 4 of DeveloperGuidelines/Internationalisation
- Timestamp:
- 07/29/09 00:56:18 (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
DeveloperGuidelines/Internationalisation
v3 v4 12 12 To make dropdown options localisable, use this pattern: 13 13 {{{ 14 table_field_opts = {'1':T('Option1'), '2':T('Option2')} 14 db.define_table(table, 15 Field('category_type', 'integer', notnull=True), 16 ... 17 ) 18 table_field_opts = {1:T('Option1'), 2:T('Option2')} 15 19 db[table][field].requires = IS_IN_SET(table_field_opts) 16 20 db[table][field].represent = lambda opt: table_field_opts[opt]