localize invite model

This commit is contained in:
wvengen 2013-02-27 11:59:03 +01:00
parent 2d1ae0ad97
commit d9949681a2
3 changed files with 8 additions and 1 deletions

View file

@ -27,7 +27,7 @@ class Invite < ActiveRecord::Base
# Custom validation: check that email does not already belong to a registered user.
def email_not_already_registered
unless User.find_by_email(self.email).nil?
errors.add(:email, 'ist bereits in Verwendung. Person ist schon Mitglied der Foodcoop.')
errors.add(:email, I18n.t('invites.errors.already_member'))
end
end

View file

@ -12,3 +12,7 @@ de:
# used by controller
success: 'Benutzerin wurde erfolgreich eingeladen.'
# used by model
errors:
already_member: 'ist bereits in Verwendung. Person ist schon Mitglied der Foodcoop.'

View file

@ -13,3 +13,6 @@ en:
# used by controller
success: 'User was invited successfully.'
# used by model
errors:
already_member: 'is already in use. Person is a member of this Foodcoop already.'