Merge pull request #437 from kubabrecka/i18n_serverside_date_2

2nd try: localize date formats on server side
This commit is contained in:
Robin Ward 2013-03-13 06:54:27 -07:00
commit dff9d65cc9
3 changed files with 10 additions and 2 deletions

View File

@ -40,7 +40,7 @@ class UserNotifications < ActionMailer::Base
@site_name = SiteSetting.title @site_name = SiteSetting.title
@last_seen_at = (@user.last_seen_at || @user.created_at).strftime("%m-%d-%Y") @last_seen_at = I18n.l(@user.last_seen_at || @user.created_at, format: :short)
# A list of new topics to show the user # A list of new topics to show the user
@new_topics = Topic.new_topics(min_date) @new_topics = Topic.new_topics(min_date)
@ -54,7 +54,7 @@ class UserNotifications < ActionMailer::Base
from: "#{I18n.t('user_notifications.digest.from', site_name: SiteSetting.title)} <#{SiteSetting.notification_email}>", from: "#{I18n.t('user_notifications.digest.from', site_name: SiteSetting.title)} <#{SiteSetting.notification_email}>",
subject: I18n.t('user_notifications.digest.subject_template', subject: I18n.t('user_notifications.digest.subject_template',
:site_name => @site_name, :site_name => @site_name,
:date => Time.now.strftime("%m-%d-%Y")) :date => I18n.l(Time.now, format: :short))
end end
end end

View File

@ -1,4 +1,8 @@
cs: cs:
time:
formats:
short: "%d.%m.%Y"
title: "Discourse" title: "Discourse"
topics: "Témata" topics: "Témata"
loading: "Nahrávám" loading: "Nahrávám"

View File

@ -1,4 +1,8 @@
en: en:
time:
formats:
short: "%m-%d-%Y"
title: "Discourse" title: "Discourse"
topics: "Topics" topics: "Topics"
loading: "Loading" loading: "Loading"