Sha256: a762673a93a426b0d72f71cf9dcabb52cc3c46dd9246f1f76837d6a6a0786c9e
Contents?: true
Size: 550 Bytes
Versions: 9
Compression:
Stored size: 550 Bytes
Contents
# Provides a simple pass-through localizer for RecordSelect. If you want # to localize RS, you need to override this method and route it to your # own system. class Object def rs_(string_to_localize, *args) args.empty? ? string_to_localize : (sprintf string_to_localize, *args) unless key.blank? text = I18n.translate "#{key}", {:scope => [:record_select], :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
9 entries across 9 versions & 1 rubygems