Comment: prevent me-too replies - merged with i18n

This commit is contained in:
Carl Chenet 2017-05-23 10:27:43 +02:00
parent 43f1c72e7c
commit 69fc4dbab8
3 changed files with 5 additions and 0 deletions

View file

@ -47,6 +47,9 @@ class Comment < ActiveRecord::Base
self.comment.to_s.strip.match(/\Atl;?dr.?$\z/i) &&
errors.add(:base, "Wow! A blue car!")
self.comment.to_s.strip.match(/\Ame too.?\z/i) &&
errors.add(:base, I18n.t( 'models.comment.metooerror'))
end
def self.arrange_for_user(user)

View file

@ -22,6 +22,7 @@ en:
threadremovedby: "Thread removed by moderator %{modoname} : %{modreason}"
turnedintodragon: "turned into a dragon"
slayeddragon: "slayed dragon"
metooerror: "Please just upvote the parent post instead."
moderation:
storyeditedby: "Your story has been edited by "
usersuggestions: "user suggestions"

View file

@ -34,6 +34,7 @@ fr:
threadremovedby: "Fil supprimé par le modérateur %{modoname} : %{modreason}"
turnedintodragon: "transformé en dragon"
slayeddragon: "le dragon a été terrassé"
metooerror: "Merci de voter pour le commentaire à la place."
moderation:
storyeditedby: "Votre info a été éditée par "
usersuggestions: "suggestions d'utilisateur"