in helper
1 2 3 4 |
def show_date(date) return '' if date.nil? || date==0 l(Time.at(date), :format => :ddate) end |
in config/locale/en.yml (for example)
1 2 3 |
date: formats: ddate: %d.%m.%Y |
in helper
1 2 3 4 |
def show_date(date) return '' if date.nil? || date==0 l(Time.at(date), :format => :ddate) end |
in config/locale/en.yml (for example)
1 2 3 |
date: formats: ddate: %d.%m.%Y |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
module I18n::Backend class Simple protected def pluralize(locale, entry, count) return entry unless entry.is_a?(Hash) and count key = :zero if count == 0 && entry.has_key?(:zero) key ||= count == 1 ? :one : (2..4).include?(count) ? :few : :other raise InvalidPluralizationData.new(entry, count) unless entry.has_key?(key) entry[key] end end # class end # module |