Permalink
Browse files

more i18n

  • Loading branch information...
1 parent 84d41f6 commit 442f74afbcd773e540ac580253f12d0e5d6488f5 Pavel Kotlyar committed Mar 28, 2012
Showing with 4 additions and 7 deletions.
  1. +2 −0 config/locales/opinio.en.yml
  2. +2 −7 lib/opinio/opinio_model.rb
@@ -12,3 +12,5 @@ en:
comment_sent: 'Comment sent successfully.'
comment_sending_error: 'Error while sending the comment.'
comment_destroyed: 'Comment removed successfully.'
+ comment_interval: 'You must wait %{time} seconds to comment again.'
+ cannot_be_comment_of_comment: "Cannot reply another comment's reply"
@@ -98,12 +98,7 @@ def last_comment_time
if (Time.now - last_comment.created_at).round >= self.comments_interval
true
else
- errors.add(
- :created_at,
- I18n.t('opinio.comment_interval',
- :time => self.comments_interval,
- :default => "You must wait %{time} seconds to comment again.")
- )
+ errors.add(:created_at, I18n.translate('opinio.messages.comment_interval', :time => self.comments_interval))
false
end
else
@@ -115,7 +110,7 @@ def last_comment_time
def cannot_be_comment_of_a_comments_comment
if new_record? && self.commentable_type == Opinio.model_name
if commentable.commentable_type == Opinio.model_name
- errors.add :base, I18n.translate('opinio.cannot_be_comment_of_comment', :default => 'Cannot reply another comment\'s reply')
+ errors.add :base, I18n.t('opinio.messages,cannot_be_comment_of_comment')
end
end
end

0 comments on commit 442f74a

Please sign in to comment.