Sha256: d4cb7551e7a7ea23a31d668950074276e91187bc8ac6eeb2afe366807f863f2f

Contents?: true

Size: 335 Bytes

Versions: 21

Compression:

Stored size: 335 Bytes

Contents

class Object
  def as_(key, options = {})
    unless key.blank?
      text = I18n.translate "#{key}", {:scope => [:active_scaffold, *options.delete(:scope)], :default => key.is_a?(String) ? key : key.to_s.titleize}.merge(options)
      # text = nil if text.include?('translation missing:')
    end
    text ||= key 
    text
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
active_scaffold-3.3.3 lib/active_scaffold/extensions/localize.rb
active_scaffold-3.3.2 lib/active_scaffold/extensions/localize.rb
active_scaffold-3.3.1 lib/active_scaffold/extensions/localize.rb
active_scaffold-3.3.0 lib/active_scaffold/extensions/localize.rb
active_scaffold-3.2.20 lib/active_scaffold/extensions/localize.rb
active_scaffold-3.3.0.rc3 lib/active_scaffold/extensions/localize.rb
active_scaffold-3.3.0.rc2 lib/active_scaffold/extensions/localize.rb
active_scaffold-3.2.19 lib/active_scaffold/extensions/localize.rb
active_scaffold-3.3.0.rc lib/active_scaffold/extensions/localize.rb
active_scaffold-3.2.17 lib/active_scaffold/extensions/localize.rb
active_scaffold-3.2.16 lib/active_scaffold/extensions/localize.rb
active_scaffold-3.2.15 lib/active_scaffold/extensions/localize.rb
active_scaffold-3.2.14 lib/active_scaffold/extensions/localize.rb
active_scaffold-3.2.13 lib/active_scaffold/extensions/localize.rb
active_scaffold-3.2.12 lib/active_scaffold/extensions/localize.rb
active_scaffold-3.2.11 lib/active_scaffold/extensions/localize.rb
active_scaffold-3.2.10 lib/active_scaffold/extensions/localize.rb
active_scaffold-3.2.9 lib/active_scaffold/extensions/localize.rb
active_scaffold-3.2.8 lib/active_scaffold/extensions/localize.rb
active_scaffold-3.2.7 lib/active_scaffold/extensions/localize.rb