{% if courses.in_catalog.any? %}
  {% assign person_groups = current_person.groups | map: "name" %}
  {% assign language = "English" %}
  <div class="np-catalog-courses row row-with-thumbnails">
    {% for course in courses.in_catalog %}
      {% if person_groups.any? %}
        {% if person_groups contains "UK applicants" or person_groups contains "UK teachers" %}
          {% assign language = "English" %}
        {% elsif person_groups contains "SWE applicants" or person_groups contains "SWE teachers" %}
          {% assign language = "Swedish" %}
        {% else %}
          {% assign language = "English" %}
        {% endif %}
      {% else %}
        {% assign language = "English" %}
      {% endif %}

      {% if course.properties.language == language %}
        <div class="col-xs-12 col-md-6 col-lg-4 np-stretch-content">
          {% include "cards_course" with course %}
        </div>
      {% endif %}
    {% endfor %}
  </div>
{% else %}
  {% capture message %}
    {% t shared.zero_state.courses.catalog,
      key: current_school.course_vocabulary
    %}
  {% endcapture %}
  {% include "courses_zero_state", message: message %}
{% endif %}
