Method: Object#as_

Defined in:
lib/six-updater-web/vendor/plugins/active_scaffold/lib/extensions/localize.rb

#as_(key, options = {}) ⇒ Object



2
3
4
5
6
7
8
9
10
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/lib/extensions/localize.rb', line 2

def as_(key, options = {})
  unless key.blank?
    # options[:default] ||= key.to_s.titleize unless ActiveScaffold::Config::Core.show_missing_translations
    # options[:default] = nil if ActiveScaffold::Config::Core.show_missing_translations
    # text = I18n.translate "#{key}", {:scope => [:active_scaffold]}.merge(options)
    text = I18n.translate "%{key}", {:scope => [:active_scaffold], :default => key.is_a?(String) ? key : key.to_s.titleize}.merge(options)
  end
  text
end