Module: Kiosk::Localizer

Defined in:
lib/kiosk/localizer.rb

Overview

Provides an ActionController filter that scopes all content resource calls to only fetch content for the default locale and localize it all to the current request locale.

Class Method Summary collapse

Class Method Details

.around(controller) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/kiosk/localizer.rb', line 9

def self.around(controller)
  WordPress::Resource.with_locale(Kiosk.origin.default_locale || I18n.default_locale) do
    WordPress::Resource.localized_to(I18n.locale) do
      yield
    end
  end
end