diff --git a/app/models/comment.rb b/app/models/comment.rb index fa000c8..92f646f 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -31,13 +31,13 @@ class Comment < ActiveRecord::Base validate do self.comment.to_s.strip == "" && - errors.add(:comment, "cannot be blank.") + errors.add(" ", I18n.t( 'models.comment.commentcannotbeblank')) self.user_id.blank? && - errors.add(:user_id, "cannot be blank.") + errors.add(" ", I18n.t( 'models.comment.useridcannotbeblank')) self.story_id.blank? && - errors.add(:story_id, "cannot be blank.") + errors.add(" ", I18n.t( 'models.comment.storyidcannotbeblank')) (m = self.comment.to_s.strip.match(/\A(t)his([\.!])?$\z/i)) && errors.add(:base, (m[1] == "T" ? "N" : "n") + "ope" + m[2].to_s) diff --git a/config/locales/en.yml b/config/locales/en.yml index 540fd2e..c4223c1 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -10,6 +10,9 @@ en: subject: "[%{appname}] You have been invited to %{appname}" models: comment: + commentcannotbeblank: "A comment cannot be blank." + useridcannotbeblank: "A user ID cannot be blank." + storyidcannotbeblank: "A story ID cannot be blank." deletedcomment: "deleted comment" threadremovedby: "Thread removed by moderator %{modoname} : %{modreason}" moderation: diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 464576d..5f764c9 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -22,6 +22,9 @@ fr: subject: "[%{appname}] Vous avez été invité au %{appname}" models: comment: + commentcannotbeblank: "Un commentaire ne peut pas être vide." + useridcannotbeblank: "Un ID utilisateur ne peut pas être vide." + storyidcannotbeblank: "Un ID d'info ne peut pas être vide." deletedcomment: "commentaire supprimé" threadremovedby: "Fil supprimé par le modérateur %{modoname} : %{modreason}" moderation: