Sha256: b9afa66ce4dd27add08272885c044c9e57d1de9648e120c596a1a2b9d33dc18d

Contents?: true

Size: 282 Bytes

Versions: 2

Compression:

Stored size: 282 Bytes

Contents

module LocaleFilter

  def self.included(receiver)
    receiver.append_before_filter :set_locale
  end

  def set_locale
    @matched_locale_from_browser = request.preferred_language_from(AvailableLanguage.all)
    I18n.locale = current_user.locale || "en" if signed_in?
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
iugusdk-1.0.0.alpha.1 lib/iugusdk/locale_filter.rb
iugusdk-1.0.0.alpha.0 lib/iugusdk/locale_filter.rb