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.2.6 | lib/active_scaffold/extensions/localize.rb |