Sha256: 37b2702d524cfe929727b7b209cc4bd651de229f11d85c7a0b3c5ba605edbe48
Contents?: true
Size: 581 Bytes
Versions: 7
Compression:
Stored size: 581 Bytes
Contents
# frozen_string_literal: true module Maglev module ContentLocaleConcern extend ActiveSupport::Concern included do alias_method :maglev_content_locale, :content_locale helper_method :maglev_content_locale, :content_locale end private def set_content_locale locale = params[:locale] || request.headers['X-MAGLEV-LOCALE'] Maglev::I18n.current_locale = locale if locale end def content_locale Maglev::I18n.current_locale end def default_content_locale maglev_site.default_locale.prefix end end end
Version data entries
7 entries across 7 versions & 1 rubygems