Sha256: 5cde88b25bb514d77d659ecb61c86fb177d24ddae7ac62b336e39ee7344f2d13
Contents?: true
Size: 745 Bytes
Versions: 62
Compression:
Stored size: 745 Bytes
Contents
module Workarea module Storefront module LocalesHelper def alternate_locales_tags return if I18n.configured_locales.one? alternate_locale_urls.reduce('') do |memo, (locale, url)| memo << tag(:link, href: url, rel: 'alternate', hreflang: locale) end.html_safe end def alternate_locale_urls I18n.configured_locales.reduce({}) do |memo, locale| next memo if locale == I18n.locale || locale.blank? memo[locale] = if locale == I18n.default_locale url_for(locale: nil) else url_for(locale: locale) end memo end end end end end
Version data entries
62 entries across 62 versions & 1 rubygems