i18n.patch

unzipped version of Alain's patch - Felix Schäfer, 2010-04-30 14:33

Download (1.11 KB)

View differences:

i18n.rb (working copy)
45 45
      time = time.to_time if time.is_a?(String)
46 46
      zone = User.current.time_zone
47 47
      local = zone ? time.in_time_zone(zone) : (time.utc? ? time.localtime : time)
48
      Setting.time_format.blank? ? ::I18n.l(local, :format => (include_date ? :default : :time)) : 
49
                                   ((include_date ? "#{format_date(time)} " : "") + "#{local.strftime(Setting.time_format)}")
48
	  if Setting.time_format.blank?
49
		if include_date
50
		  Setting.date_format.blank? ?
51
				::I18n.l(local, :format => :default) : 
52
				local.strftime(Setting.date_format+' '+::I18n.t(:'time.formats.time'))
53
		else
54
			::I18n.l(local, :format => :time)
55
		end
56
	  else
57
		if include_date
58
		  Setting.date_format.blank? ?
59
				::I18n.l(local, :format => ::I18n.t(:'date.formats.default')+' '+Setting.time_format) :
60
				local.strftime(Setting.date_format+' '+Setting.time_format)
61
		else
62
			local.strftime(Setting.time_format)
63
		end
64
	  end
50 65
    end
51 66

  
52 67
    def day_name(day)