Sha256: 2825ac7f1d99f48d4efe32863c0c722626207ed79dc1da362d7ee1d2162b4f40

Contents?: true

Size: 310 Bytes

Versions: 100

Compression:

Stored size: 310 Bytes

Contents

class Object
  def as_(key, options = {})
    unless key.blank?
      text = I18n.translate "#{key}", {:scope => [:active_scaffold], :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

100 entries across 100 versions & 7 rubygems

Version Path
active_scaffold_vho-4.0.0 lib/active_scaffold/extensions/localize.rb
active_scaffold_vho-3.2.14 lib/active_scaffold/extensions/localize.rb
active_scaffold_vho-3.2.13 lib/active_scaffold/extensions/localize.rb
active_scaffold-sequel-0.8.0 lib/active_scaffold/extensions/localize.rb
active_scaffold-sequel-0.7.1 lib/active_scaffold/extensions/localize.rb
active_scaffold_vho-3.2.12 lib/active_scaffold/extensions/localize.rb
active_scaffold_vho-3.2.11 lib/active_scaffold/extensions/localize.rb
active_scaffold_vho-3.2.10 lib/active_scaffold/extensions/localize.rb
active_scaffold_vho-3.2.9 lib/active_scaffold/extensions/localize.rb
active_scaffold_vho-3.2.8 lib/active_scaffold/extensions/localize.rb
active_scaffold_vho-3.2.7 lib/active_scaffold/extensions/localize.rb
active_scaffold_vho-3.2.6 lib/active_scaffold/extensions/localize.rb
active_scaffold_vho-3.2.5 lib/active_scaffold/extensions/localize.rb
active_scaffold_vho-3.2.4 lib/active_scaffold/extensions/localize.rb
active_scaffold_vho-3.2.3 lib/active_scaffold/extensions/localize.rb
active_scaffold_vho-3.2.2 lib/active_scaffold/extensions/localize.rb
active_scaffold_vho-3.2.1 lib/active_scaffold/extensions/localize.rb
active_scaffold-sequel-0.7.0 lib/active_scaffold/extensions/localize.rb
active_scaffold_vho-3.2.0 lib/active_scaffold/extensions/localize.rb
active_scaffold_vho-3.0.31 lib/active_scaffold/extensions/localize.rb