'Language menu layout
options for each entry:
- lang_code: the language code
- lang_name: the language name'

@staticmethod
def layout(item):

    if item.enabled:
        if item.components:
            T = current.T
            items = item.render_components()
            select = SELECT(items, _name='_language', _title=T('Language    Selection'), _onchange="S3.reloadWithQueryStringVars({'_language':$(this).val()})", value=T.accepted_language)
            classes = ['language-selector']
            form = FORM(select, _class='    '.join(classes), _name='_language', _action='', _method='get')
            list_item = LI(form, _class='has-form')
            if item.opts.right:
                list_item.add_class('menu-right')
            return list_item
        else:
            return OPTION(item.opts.lang_name, _value=item.opts.lang_code)
    else:
        return None
