Skip to content

Commit

Permalink
Check Refinery::I18n is defined in site bar helper and partial
Browse files Browse the repository at this point in the history
  • Loading branch information
atj committed Mar 16, 2011
1 parent a395740 commit 57ef8bc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/app/views/shared/_site_bar.html.erb
Expand Up @@ -18,7 +18,7 @@
<%= RefinerySetting.find_or_set(:site_name, 'Company Name') %>
</span>

<%= 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' %>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions core/lib/refinery/helpers/site_bar_helper.rb
Expand Up @@ -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
Expand Down

0 comments on commit 57ef8bc

Please sign in to comment.