From 57ef8bcb648b619df7d3fda21e4619791f8ac106 Mon Sep 17 00:00:00 2001 From: Adam James Date: Wed, 16 Mar 2011 13:14:44 +0000 Subject: [PATCH] Check Refinery::I18n is defined in site bar helper and partial --- core/app/views/shared/_site_bar.html.erb | 2 +- core/lib/refinery/helpers/site_bar_helper.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/app/views/shared/_site_bar.html.erb b/core/app/views/shared/_site_bar.html.erb index e95b3cb308..9091707ae2 100644 --- a/core/app/views/shared/_site_bar.html.erb +++ b/core/app/views/shared/_site_bar.html.erb @@ -18,7 +18,7 @@ <%= RefinerySetting.find_or_set(:site_name, 'Company Name') %> - <%= link_to t('.log_out', :locale => ::Refinery::I18n.current_locale), + <%= link_to t('.log_out', :locale => (defined?(::Refinery::I18n) ? ::Refinery::I18n.current_locale : :en)), destroy_user_session_path, :id => 'logout' %> diff --git a/core/lib/refinery/helpers/site_bar_helper.rb b/core/lib/refinery/helpers/site_bar_helper.rb index d58faceb65..b76a21afa4 100644 --- a/core/lib/refinery/helpers/site_bar_helper.rb +++ b/core/lib/refinery/helpers/site_bar_helper.rb @@ -4,13 +4,13 @@ module SiteBarHelper # Generates the link to determine where the site bar switch button returns to. def site_bar_switch_link - link_to_if(admin?, t('.switch_to_your_website', :locale => ::Refinery::I18n.current_locale), + link_to_if(admin?, t('.switch_to_your_website', :locale => (defined?(::Refinery::I18n) ? ::Refinery::I18n.current_locale : :en), (if session.keys.include?(:website_return_to) and session[:website_return_to].present? session[:website_return_to] else root_path(:locale => (::Refinery::I18n.default_frontend_locale if defined?(::Refinery::I18n) && ::Refinery::I18n.enabled?)) end)) do - link_to t('.switch_to_your_website_editor', :locale => ::Refinery::I18n.current_locale), + link_to t('.switch_to_your_website_editor', :locale => (defined?(::Refinery::I18n) ? ::Refinery::I18n.current_locale : :en)), (if session.keys.include?(:refinery_return_to) and session[:refinery_return_to].present? session[:refinery_return_to] else