Added hreflang alternate urls

This commit is contained in:
Godwin
2016-06-17 19:18:18 -07:00
parent 2ee8849153
commit 70fd4ccef8
6 changed files with 35 additions and 20 deletions
@@ -34,6 +34,12 @@ class ApplicationController < LinguaFrancaApplicationController
halt_redirection!
end
@alt_lang_urls = {}
I18n.backend.enabled_locales.each do |locale|
locale = locale.to_s
@alt_lang_urls[locale] = view_context.url_for_locale(locale) # don't show the current locale
end
# call the base method to detect the language
super
end