app/controllers/events_controller.rb in radiant-event_calendar-extension-1.3.9 vs app/controllers/events_controller.rb in radiant-event_calendar-extension-1.4.0

- old
+ new

@@ -93,12 +93,12 @@ end def list_description return @description if @description parts = [] - parts << (period ? period.description : "coming up") - parts << "in #{calendars.to_sentence}" if calendars + parts << (period ? period.description : t('event_page.coming_up')) + parts << I18n.t('event_page.in_calendars', :calendars => calendars.to_sentence) if calendars @description = parts.join(' ') end # these methods build calendar links by using supplied parameters to amend the current parameter set # anything not mentioned is carried forward unchanged. @@ -152,34 +152,34 @@ def calendar_parameter_names [:year, :month, :mday, :category, :slug, :calendar_id] end - def day_names - return @day_names if @day_names - @day_names ||= Date::DAYNAMES.dup - @day_names.push(@day_names.shift) # Class::Date and ActiveSupport::CoreExtensions::Time::Calculations have different ideas of when is the start of the week. We've gone for the rails standard. - @day_names - end - def month_name(month) month_names[month] end - - def month_names - @month_names ||= Date::MONTHNAMES.dup - end - + def short_month_name(month) short_month_names[month] end - + + def day_names + return @day_names if @day_names + @day_names ||= (I18n.t 'date.day_names').dup + @day_names.push(@day_names.shift) # Class::Date and ActiveSupport::CoreExtensions::Time::Calculations have different ideas of when is the start of the week. We've gone for the rails standard. + @day_names + end + +protected + def short_month_names - @short_month_names ||= Date::ABBR_MONTHNAMES.dup + @short_month_names ||= (I18n.t 'date.abbr_month_names').dup end - -private - + + def month_names + @month_names ||= (I18n.t 'date.month_names').dup + end + # months can be passed around either as names or numbers # any date part can be 'now' or 'next' for ease of linking # and everything is converted to_i to save clutter later def numerical_parameters