{% load i18n %}

<tr class="border-t border-solid border-gray-200 hover:bg-gray-100">
    <td>
        <a href="{% url 'edit_language' slug=language.slug %}" class="block py-3 pl-4 pr-2 text-gray-800">
            {{ language.translated_name }}
        </a>
    </td>
    <td class="pr-2">
        {{ language.native_name }}
    </td>
    <td class="pr-2">
        {{ language.slug }}
    </td>
    <td class="pr-2">
        {{ language.bcp47_tag }}
    </td>
    <td class="pr-2">
        <span class="fp fp-{{ language.primary_country_code }} fp-rounded " title="{{ language.get_primary_country_code_display }}"></span>
        <span class="fp fp-{{ language.secondary_country_code }} fp-rounded " title="{{ language.get_secondary_country_code_display }}"></span>
    </td>
      <td class="pr-2">
        {{ language.get_text_direction_display }}
    </td>
    <td class="pr-2">
        {{ language.created_date }}
    </td>
    <td class="pr-2">
        {{ language.last_updated }}
    </td>
    <td class="pr-2 text-right">
        {{ language.language_tree_nodes.count }}
    </td>
    <td class="pl-2 pr-4 text-right">
        {% if perms.cms.delete_language %}
            {% if language.language_tree_nodes.exists %}
                <button title="{% trans 'You cannot delete a language that is used in at least one region.' %}" class="btn-icon" disabled>
                    <i data-feather="trash-2"></i>
                </button>
            {% else %}
                <button title="{% trans 'Delete language' %}" class="confirmation-button btn-icon"
                        data-confirmation-title="{{ delete_dialog_title }}"
                        data-confirmation-text="{{ delete_dialog_text }}"
                        data-confirmation-subject="{{ language.translated_name }}"
                        data-action="{% url 'delete_language' slug=language.slug %}">
                    <i data-feather="trash-2"></i>
                </button>
            {% endif %}
        {% endif %}
    </td>
</tr>
