app/helpers/admin/i18n_helper.rb
def i18n_object_for( object )

      # if it’s a string…
      if object.is_a?( String )

        klass = object.constantize

      elsif !object.is_a?( Class )

        klass = object.class

      else

        klass = object

      end

      # if we can get a model name
      if klass.respond_to?( :model_name )

        return klass.model_name

      end

      raise "Cannot find internationalization key for #{object.inspect}"

    end
# Returns the i18n-friendly object for a given class/instance/etc.
Returns the i18n-friendly object for a given class/instance/etc.
Returns the i18n - friendly object for a given class / instance / etc .
def i18n_object_for( object )
      if object.is_a?( String )
        klass = object.constantize
      elsif !object.is_a?( Class )
        klass = object.class
      else
        klass = object
      end
      if klass.respond_to?( :model_name )
        return klass.model_name
      end
      raise "Cannot find internationalization key for #{object.inspect}"
    end
def i18n_object_for ( object ) if object . is_a? ( String ) klass = object . constantize elsif ! object . is_a? ( Class ) klass = object . class else klass = object end if klass . respond_to? ( :model_name ) return klass . model_name end raise "Cannot find internationalization key for #{object.inspect}" end
Returns the i18n-friendly object for a given class/instance/etc.
Returns the i18n - friendly object for a given class / instance / etc .
# if it’s a string… # if we can get a model name
object