Skip to content

Commit

Permalink
Sugar syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
Luca Guidi committed Aug 5, 2008
1 parent e19f1c8 commit ce0dac7
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions lib/click_to_globalize.rb
Expand Up @@ -203,15 +203,12 @@ def globalize?
# request is processed.
# <tt>LocaleObserver</tt> catches all translations and pass them to the session.
def observe_locales
unless globalize?
yield
else
locale_observer = LocaleObserver.new
Locale.add_observer(locale_observer)
yield
Locale.remove_observer(locale_observer)
session[:__globalize_translations] = format_translations(locale_observer)
end
yield and return unless globalize?
locale_observer = LocaleObserver.new
Locale.add_observer(locale_observer)
yield
Locale.remove_observer(locale_observer)
session[:__globalize_translations] = format_translations(locale_observer)
end

# Fetch the translations from the given LocaleObserver.
Expand Down

0 comments on commit ce0dac7

Please sign in to comment.