Skip to content

Latest commit

 

History

History
19 lines (13 loc) · 466 Bytes

translations.rst

File metadata and controls

19 lines (13 loc) · 466 Bytes

Lazy translations

2.7

You may want to display field labels or choice names in a particular user's local language. For those cases, the schema also supports lazy translations:

from django.utils.translation import gettext_lazy as _


{
    'type': 'string',
    'title': _('Occupation'),
    'choices': [_('Teacher'), _('Doctor'), _('Engineer')],
    'default': _('Teacher')
}