Sha256: 6c7a20a91aef9f491ee4c694d4e40d7edd62d440e8d35abfcda1e29c95247bb0

Contents?: true

Size: 1.23 KB

Versions: 11

Compression:

Stored size: 1.23 KB

Contents

<%
  brand ||= false
  brand_helper = GovukPublishingComponents::AppHelpers::BrandHelper.new(brand)
  translation_helper = GovukPublishingComponents::Presenters::TranslationNavHelper.new(local_assigns)
%>
<% if translation_helper.has_translations? %>
  <nav role="navigation"
    class="gem-c-translation-nav <%= translation_helper.classes %> <%= brand_helper.brand_class %>"
    aria-label="<%= t("common.translations") %>"
    <%= "data-module=\"gem-track-click\"" if translation_helper.tracking_is_present? %>
  >
    <ul class="gem-c-translation-nav__list">
      <% translation_helper.translations.each.with_index do |translation, i| %>
        <li class="gem-c-translation-nav__list-item">
          <% if translation[:active] %>
            <span lang="<%= translation[:locale] %>"><%= translation[:text] %></span>
          <% else %>
            <%= link_to translation[:text], translation[:base_path],
              hreflang: translation[:locale],
              lang: translation[:locale],
              rel: "alternate",
              class: "gem-c-translation-nav__link #{brand_helper.color_class}",
              data: translation[:data_attributes]
            %>
          <% end %>
        </li>
      <% end %>
    </ul>
  </nav>
<% end %>

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
govuk_publishing_components-24.9.1 app/views/govuk_publishing_components/components/_translation_nav.html.erb
govuk_publishing_components-24.9.0 app/views/govuk_publishing_components/components/_translation_nav.html.erb
govuk_publishing_components-24.8.0 app/views/govuk_publishing_components/components/_translation_nav.html.erb
govuk_publishing_components-24.7.1 app/views/govuk_publishing_components/components/_translation_nav.html.erb
govuk_publishing_components-24.7.0 app/views/govuk_publishing_components/components/_translation_nav.html.erb
govuk_publishing_components-24.6.1 app/views/govuk_publishing_components/components/_translation_nav.html.erb
govuk_publishing_components-24.6.0 app/views/govuk_publishing_components/components/_translation_nav.html.erb
govuk_publishing_components-24.5.0 app/views/govuk_publishing_components/components/_translation_nav.html.erb
govuk_publishing_components-24.4.1 app/views/govuk_publishing_components/components/_translation_nav.html.erb
govuk_publishing_components-24.4.0 app/views/govuk_publishing_components/components/_translation_nav.html.erb
govuk_publishing_components-24.3.1 app/views/govuk_publishing_components/components/_translation_nav.html.erb