Browse Source

Merge branch 'development' of https://github.com/bikebike/BikeBike into development

development
Godwin 8 years ago
parent
commit
040aa5e109
  1. 9
      app/controllers/application_controller.rb
  2. 4
      app/views/application/locale_not_available.html.haml

9
app/controllers/application_controller.rb

@ -152,6 +152,15 @@ class ApplicationController < BaseController
@page_title = 'page_titles.404.Locale_Not_Available'
@main_title_vars = { vars: { language: view_context.language_name(locale) } }
@main_title = 'error.locale_not_available.title'
unless @alt_lang_urls.present?
@alt_lang_urls = {}
I18n.backend.enabled_locales.sort.each do |locale|
locale = locale.to_s
@alt_lang_urls[locale] = view_context.url_for_locale(locale) # don't show the current locale
end
end
render 'application/locale_not_available', status: 404
end

4
app/views/application/locale_not_available.html.haml

@ -1,9 +1,9 @@
= render :partial => 'application/header', :locals => {:image_file => 'runes.jpg'}
= render partial: 'application/header', locals: {image_file: 'runes.jpg'}
= row do
= columns(medium: 12) do
%p= _'error.locale_not_available.description', :p, @main_title_vars
%ul.locales
- @alt_lang_urls.each do |locale, url|
- (@alt_lang_urls || I18n.backend.enabled_locales.sort || [:en]).each do |locale, url|
%li
- locale_translation = language_name(locale, true)
%a.button{href: url, lang: locale}

Loading…
Cancel
Save