<!--Descriptive page name, messages and instructions-->
<h2 class="heading"><%= t(".page_heading") %></h2>
<!--/descriptions-->

<!--subnav-->
<p class="navigation actions" role="navigation">
  <% if policy(Language).new? %>
    <%= link_to t(".navigation.add"), new_language_path %>
  <% else %>
    <%= link_to t(".navigation.suggest"), new_feedback_report_path %>
  <% end %>
</p>
<!--/subnav-->

<!--main content-->
<dl class="language index group">
  <% @languages.each do |language| %>
    <% works_count = estimate_number(@works_counts[language.short] || 0) %>
    <% if language == Language.default %>
      <dt>
        <span lang="<%= language.short %>"><%= language.name %></span>
        <%= t(".language_code_format_html", code: content_tag(:abbr, language.short)) %>
      </dt>
      <dd>
        <%= link_to t(".works_count", count: works_count, formatted_count: number_with_delimiter(works_count)), works_path %>
      </dd>
    <% else %>
      <dt>
        <%= link_to language.name, language, lang: language.short %>
        <%= t(".language_code_format_html", code: content_tag(:abbr, language.short)) %>
      </dt>
      <dd>
        <%= link_to t(".works_count", count: works_count, formatted_count: number_with_delimiter(works_count)), language_works_path(language) %>
        <% if policy(Language).edit? %>
          <p class="actions">
            <%= link_to t(".navigation.edit"), edit_language_path(language) %>
          </p>
        <% end %>
      </dd>
    <% end %>
  <% end %>
</dl>
<!--main content-->
