From 6e0e46435e9f2d6cc8fcfef073b20bb0d5eb2d6a Mon Sep 17 00:00:00 2001 From: MrZYX Date: Tue, 8 Feb 2011 16:26:56 +0100 Subject: [PATCH] localize dates --- app/controllers/notifications_controller.rb | 2 +- app/helpers/people_helper.rb | 4 ++-- config/locales/diaspora/en.yml | 6 +++++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/controllers/notifications_controller.rb b/app/controllers/notifications_controller.rb index 4542f8668..f6a6d1eed 100644 --- a/app/controllers/notifications_controller.rb +++ b/app/controllers/notifications_controller.rb @@ -20,7 +20,7 @@ class NotificationsController < ApplicationController def index @notifications = Notification.find(:all, :conditions => {:recipient_id => current_user.id}, :order => 'updated_at desc', :include => [:target, {:actors => :profile}]).paginate :page => params[:page], :per_page => 25 - @group_days = @notifications.group_by{|note| note.updated_at.strftime("%B %d") } + @group_days = @notifications.group_by{|note| I18n.l(note.updated_at, :format => I18n.t('date.formats.fullmonth_day')) } respond_with @notifications end diff --git a/app/helpers/people_helper.rb b/app/helpers/people_helper.rb index 03f5e47b8..b149abca8 100644 --- a/app/helpers/people_helper.rb +++ b/app/helpers/people_helper.rb @@ -22,9 +22,9 @@ module PeopleHelper def birthday_format(bday) if bday.year == 1000 - bday.strftime("%B %d") + I18n.l bday, :format => I18n.t('date.formats.birthday') else - bday.strftime("%B %d %Y") + I18n.l bday, :format => I18n.t('date.formats.birthday_with_year') end end end diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index bc9539410..1c5a359a7 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -497,4 +497,8 @@ en: pagination: next: "Next" previous: "Previous" - + date: + formats: + fullmonth_day: "%B %d" + birthday: "%B %d" + birthday_with_year: "%B %d %Y"