<%=
  render partial: 'content/contexts/relation', locals: {
    content_type: Character,
    content: content,
    relation_class: Lingualism,
    relation_class_id: :spoken_language_id,
    relation_text: :spoken_by
  }
%>

<%=
  render partial: 'content/contexts/relation', locals: {
    content_type: Location,
    content: content,
    relation_class: LocationLanguageship,
    relation_class_id: :language_id,
    relation_text: :spoken_in
  }
%>

<% @references.each do |content_type, relations| %>
  <% next unless relations.any? %>
  <%
  card_title = if relations.count == 1
    if relations.first.first.include? '<plural>'
      relations.first.first
    else
      [
        relations.first.first,
        ' ',
        pluralize(relations.count, "#{content_type.to_s.singularize}")
      ].join
    end
  else
    [
      'Related to ',
      pluralize(relations.count, "other #{content_type.to_s.singularize}")
    ].join
  end
  %>
  <div class="col s12 m6 l4">
    <%= render partial: 'content/cards/content_relation_list', locals: {
      content_type: content_type,
      relations:    relations,
      card_title:   card_title
    } %>
  </div>
<% end %>
