aboutsummaryrefslogblamecommitdiffstats
path: root/actionpack/lib/abstract_controller/translation.rb
blob: b6c484d188267e7ccd9d81711908e53caa2a392e (plain) (tree)
1
2
3
4
5
6
7
8
9
                         

                        





                                                                            
                           



                       
                          


                      
   
module AbstractController
  module Translation
    def translate(*args)
      key = args.first
      if key.is_a?(String) && (key[0] == '.')
        key = "#{ controller_path.gsub('/', '.') }.#{ action_name }#{ key }"
        args[0] = key
      end

      I18n.translate(*args)
    end
    alias :t :translate

    def localize(*args)
      I18n.localize(*args)
    end
    alias :l :localize
  end
end