Skip to content

Commit

Permalink
Ensure we globalize on the frontend by assigning whatever we find the…
Browse files Browse the repository at this point in the history
… locale to be to Thread.current[:globalize_locale]. Relates to [Refinery issue 592](https://github.com/resolve/refinerycms/issues/592). Bumped to 1.0.0
  • Loading branch information
parndt committed Apr 13, 2011
1 parent 94fecaa commit f7eb004
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
4 changes: 2 additions & 2 deletions lib/gemspec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env ruby
version = '0.9.9.16'
version = '1.0.0'
raise "Could not get version so gemspec can not be built" if version.nil?
files = Dir.glob("**/*").flatten.reject do |file|
file =~ /\.gem(spec)?$/
Expand All @@ -14,7 +14,7 @@
s.summary = %q{i18n logic for Refinery CMS.}
s.email = %q{[email protected]}
s.homepage = %q{http://refinerycms.com}
s.authors = %w(Resolve\\ Digital)
s.authors = ['Philip Arndt']
s.require_paths = %w(lib)
s.add_dependency 'refinerycms-core', '>= 0.9.9.12'
Expand Down
5 changes: 3 additions & 2 deletions lib/refinery/i18n.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Engine < Rails::Engine
end

config.to_prepare do
::ApplicationController.class_eval do
::ApplicationController.module_eval do
before_filter lambda {|c|
::SimplesIdeias::I18n.export! if Rails.env.development?
}
Expand All @@ -31,7 +31,7 @@ def default_url_options(options={})

def find_or_set_locale
if ::Refinery::I18n.enabled?
::I18n.locale = ::Refinery::I18n.current_locale
::I18n.locale = ::Refinery::I18n.current_frontend_locale

if ::Refinery::I18n.has_locale?(locale = params[:locale].try(:to_sym))
::I18n.locale = locale
Expand All @@ -41,6 +41,7 @@ def find_or_set_locale
else
::I18n.locale = ::Refinery::I18n.default_frontend_locale
end
Thread.current[:globalize_locale] = ::I18n.locale
end
end

Expand Down
10 changes: 5 additions & 5 deletions refinerycms-i18n.gemspec
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Gem::Specification.new do |s|
s.name = %q{refinerycms-i18n}
s.version = %q{0.9.9.16}
s.version = %q{1.0.0}
s.description = %q{i18n logic extracted from RefineryCMS, for Refinery CMS.}
s.date = %q{2011-03-28}
s.date = %q{2011-04-13}
s.summary = %q{i18n logic for Refinery CMS.}
s.email = %q{info@refinerycms.com}
s.homepage = %q{http://refinerycms.com}
s.authors = %w(Resolve\ Digital)
s.email = %q{parndt@gmail.com}
s.homepage = %q{http://philiparndt.name}
s.authors = ['Philip Arndt']
s.require_paths = %w(lib)

s.add_dependency 'refinerycms-core', '>= 0.9.9.12'
Expand Down

0 comments on commit f7eb004

Please sign in to comment.