diff options
author | Louise Crow <louise.crow@gmail.com> | 2014-01-08 15:51:10 +0000 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2014-01-08 15:51:10 +0000 |
commit | 4ce72d27785ba39fb8571376a84569f508b6feaf (patch) | |
tree | 0103b3363c4a95aeedb30b0a4dcf7d5ab93f06b4 /app/models | |
parent | 9a15599694e691d2f23596fcf9bb9f05e7b6c451 (diff) |
Make custom error messages translated.
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/profile_photo.rb | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/app/models/profile_photo.rb b/app/models/profile_photo.rb index 322ebe53c..6c3b2cfa0 100644 --- a/app/models/profile_photo.rb +++ b/app/models/profile_photo.rb @@ -70,21 +70,25 @@ class ProfilePhoto < ActiveRecord::Base def data_and_draft_checks if self.data.nil? - errors.add(:data, N_("Please choose a file containing your photo.")) + errors.add(:data, _("Please choose a file containing your photo.")) return end if self.image.nil? - errors.add(:data, N_("Couldn't understand the image file that you uploaded. PNG, JPEG, GIF and many other common image file formats are supported.")) + errors.add(:data, _("Couldn't understand the image file that you uploaded. PNG, JPEG, GIF and many other common image file formats are supported.")) return end if self.image.format != 'PNG' - errors.add(:data, N_("Failed to convert image to a PNG")) + errors.add(:data, _("Failed to convert image to a PNG")) end if !self.draft && (self.image.columns != WIDTH || self.image.rows != HEIGHT) - errors.add(:data, N_("Failed to convert image to the correct size: at {{cols}}x{{rows}}, need {{width}}x{{height}}", :cols => self.image.columns, :rows => self.image.rows, :width => WIDTH, :height => HEIGHT)) + errors.add(:data, _("Failed to convert image to the correct size: at {{cols}}x{{rows}}, need {{width}}x{{height}}", + :cols => self.image.columns, + :rows => self.image.rows, + :width => WIDTH, + :height => HEIGHT)) end if self.draft && self.user_id |