Module: Locomotive::Steam::Liquid::Tags::Concerns::I18nPage

Included in:
AltPageLinks, LinkTo, LocaleSwitcher, PathTo, RedirectTo
Defined in:
lib/locomotive/steam/liquid/tags/concerns/i18n_page.rb

Instance Method Summary collapse

Instance Method Details

#change_page_locale(locale, drop, &block) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/locomotive/steam/liquid/tags/concerns/i18n_page.rb', line 9

def change_page_locale(locale, drop, &block)
  page = drop.send(:_source)

  page.__with_locale__(locale) do
    if page.templatized? && page.content_entry
      page.content_entry.__with_locale__(locale) { yield }
    else
      yield
    end
  end
end