<tal:block condition="view/show"
           i18n:domain="plone">

<dl class="portlet portletLanguage">
    <dt class="portletHeader">
        <span class="portletTopLeft"></span>
        <span class="tile" i18n:translate="box_languages">Languages</span>
        <span class="portletTopRight"></span>
    </dt>

    <dd class="portletItem" tal:define="showFlags view/showFlags">
        <ul>
            <li tal:repeat="lang view/languages">
                <span tal:define="code lang/code;
                                  selected lang/selected"
                      tal:omit-tag="selected">

                    <a href=""
                       tal:define="flag lang/flag;
                                   name lang/name"
                       tal:attributes="href string:${here/absolute_url}/switchLanguage?set_language=${code};
                                       title name">
                        <tal:flag condition="python:showFlags and flag">
                            <img width="14"
                                 height="11"
                                 alt=""
                                 tal:attributes="src string:${view/portal_url}${flag};
                                                 title python: name;
                                                 class python: selected and 'currentItem' or '';" />
                        </tal:flag>
                        <span tal:replace="lang/native">Native language name</span>
                    </a>

                </span>
            </li>
        </ul>

        <span class="portletBottomLeft"></span>
        <span class="portletBottomRight"></span>
    </dd>
</dl>
</tal:block>
