Correctly handle translations for "configuration schemas"
This commit is contained in:
parent
49c38ae563
commit
ec91efe1f7
|
@ -15,14 +15,14 @@ class SettingsDirectory(AccessControlled, Directory):
|
|||
for option_name in schema['options']:
|
||||
option = schema['options'][option_name]
|
||||
if option['type'] == 'boolean':
|
||||
form.add(CheckboxWidget, option_name, title = option.get('title'),
|
||||
value = cfg.get(option_name, option.get('default',False)))
|
||||
form.add(CheckboxWidget, option_name, title = _(option.get('title')),
|
||||
value = cfg.get(option_name, option.get('default', False)))
|
||||
form.add_submit('submit', _('Submit'))
|
||||
form.add_submit('cancel', _('Cancel'))
|
||||
return form
|
||||
|
||||
def config_page_from_schema(self, schema):
|
||||
title = schema['title']
|
||||
title = _(schema['title'])
|
||||
name = schema['name']
|
||||
form = self.schema_to_form(schema)
|
||||
if form.get_widget('cancel').parse():
|
||||
|
@ -37,11 +37,11 @@ class SettingsDirectory(AccessControlled, Directory):
|
|||
|
||||
session_cfg_schema = {
|
||||
'name': 'session',
|
||||
'title': _('Session'),
|
||||
'title': N_('Session'),
|
||||
'options': {
|
||||
'ip_linked': { 'type': 'boolean',
|
||||
'default': False,
|
||||
'title': _('Fix sessions to an IP address')},
|
||||
'title': N_('Fix sessions to an IP address')},
|
||||
},
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue