translate grouped error message for url already posted days ago

This commit is contained in:
Carl Chenet 2018-10-16 19:23:56 +02:00
parent e11889734d
commit 105d687a4c
3 changed files with 3 additions and 2 deletions

View file

@ -71,8 +71,7 @@ class Story < ActiveRecord::Base
if self.new_record? && (s = Story.find_similar_by_url(self.url))
self.already_posted_story = s
if s.is_recent?
errors.add(:url, "has already been submitted within the past " <<
"#{RECENT_DAYS} days")
errors.add(:url, I18n.t('models.story.alreadysubmitted', :days => "#{RECENT_DAYS}"))
end
end
else

View file

@ -41,6 +41,7 @@ en:
unmerged: "unmerged from another story"
changedfromto: "changed %{story} from %{stfrom} to %{stto}"
nonmedia: "Must have at least one non-media (PDF, video) tag. If no tags apply to your content, it probably doesn't belong here."
alreadysubmitted: "Url has already been submitted within the past %{days} days."
vote:
offtopicvote: "Off-topic"
incorrectvote: "Incorrect"

View file

@ -53,6 +53,7 @@ fr:
unmerged: "dé-fusionnée depuis une autre info"
changedfromto: "%{story} changée de %{stfrom} à %{stto}"
nonmedia: "Une étiquette autre que PDF ou video doit être présente"
alreadysubmitted: "a déjà été proposée il y a %{days} jours"
vote:
offtopicvote: "Hors-sujet"
incorrectvote: "Incorrecte"