GettextI18nRails::ActiveRecord

Public Instance Methods

human_attribute_name(attribute, *args) click to toggle source

CarDealer.sales_count -> s_('CarDealer|Sales count') -> 'Sales count' if no translation was found

# File lib/gettext_i18n_rails/active_record.rb, line 3
def human_attribute_name(attribute, *args)
  s_(gettext_translation_for_attribute_name(attribute))
end
human_name(*args) click to toggle source

CarDealer -> _('car dealer')

# File lib/gettext_i18n_rails/active_record.rb, line 8
def human_name(*args)
  _(self.human_name_without_translation)
end
human_name_without_translation() click to toggle source
# File lib/gettext_i18n_rails/active_record.rb, line 12
def human_name_without_translation
  self.to_s.underscore.gsub('_',' ')
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.