Skip to content

Commit

Permalink
Allow enabled to be set.
Browse files Browse the repository at this point in the history
  • Loading branch information
parndt committed May 30, 2011
1 parent b58e013 commit 49bfdf5
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions lib/refinery/i18n.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,13 @@ class << self
attr_accessor :built_in_locales, :current_locale, :current_frontend_locale,
:default_locale, :default_frontend_locale, :enabled, :locales

def enabled=(value)
@enabled = Refinery::Setting.set(:i18n_translation_enabled, {
:value => value,
:scoping => 'refinery'
})
end

def enabled?
::Refinery::Setting.find_or_set(:i18n_translation_enabled, true, {
:scoping => 'refinery'
Expand All @@ -118,11 +125,10 @@ def current_locale
end

def current_locale=(locale)
value = {
::Refinery::Setting.set(:i18n_translation_current_locale, {
:value => locale.to_sym,
:scoping => 'refinery'
}
::Refinery::Setting.set(:i18n_translation_current_locale, value)
})

::I18n.locale = locale.to_sym
end
Expand Down

0 comments on commit 49bfdf5

Please sign in to comment.