'Helper to translate form subheadings
@param setting: the subheadings-setting (a dict)
@return: the subheadings dict with translated headers'

@classmethod
def subheadings_l10n(cls, setting):

    if (setting is None):
        return None
    T = current.T
    output = {}
    for (header, fields) in setting.items():
        if isinstance(fields, dict):
            subheadings = fields.get('subheadings')
            fields = {'fields': fields.get('fields')}
            if subheadings:
                fields['subheadings'] = cls.subheadings_l10n(subheadings)
        output[s3_str(T(header))] = fields
    return output
