From 105d687a4ceda716371b2c4206625632bc791a66 Mon Sep 17 00:00:00 2001 From: Carl Chenet Date: Tue, 16 Oct 2018 19:23:56 +0200 Subject: [PATCH] translate grouped error message for url already posted days ago --- app/models/story.rb | 3 +-- config/locales/en.yml | 1 + config/locales/fr.yml | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/models/story.rb b/app/models/story.rb index d3dab23..3fa4c48 100644 --- a/app/models/story.rb +++ b/app/models/story.rb @@ -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 diff --git a/config/locales/en.yml b/config/locales/en.yml index 9edaa7e..a5c7454 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -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" diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 838d038..d1093b1 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -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"