halogenandtoast / oath

Oath is rails authentication made simple. Previously known as Monban

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Notices should use I18n

halogenandtoast opened this issue · comments

Originally I thought this, but there's only one notice here and it's configurable so I don't think this is necessary anymore.

I need I18n for notice. For now, I do like this

class ApplicationController < ActionController::Base
  include Monban::ControllerHelpers

  before_action :set_notice
  before_action :require_login

  def set_notice
    if params[:lang] == 'en'
      Monban.config.sign_in_notice = 'foo'
    elsif params[:lang] == 'ja'
      Monban.config.sign_in_notice = 'bar'
    end
  end
end

It works, but I think this is not good idea. Do you have other idea?

@shishi I just pushed a release that makes this a bit easier. Check the documentation here:

https://github.com/halogenandtoast/monban#using-i18n-for-sign-in-notice

@shishi please upgrade to 1.1.0

Thanks! I will try

It works perfectly!

嬉しい