Permalink
Browse files

fix #9 translation mmissing.

  • Loading branch information...
1 parent 98b9ca5 commit e2f8f11a3d560839571c516399d08b4d6858e5b6 @chloerei committed Sep 3, 2012
Showing with 6 additions and 4 deletions.
  1. +4 −4 app/validators/current_password_validator.rb
  2. +1 −0 config/locales/en.yml
  3. +1 −0 config/locales/zh-CN.yml
@@ -1,16 +1,16 @@
class CurrentPasswordValidator < ActiveModel::EachValidator
def initialize(options)
options[:column] ||= []
-
+
super
end
-
+
def validate_each(record, attribute, value)
if (record.changed & options[:fields].map(&:to_s)).any?
if record.current_password.blank?
- record.errors.add(attribute, :blank)
+ record.errors.add(attribute, :blank)
elsif BCrypt::Password.new(record.password_digest) != record.current_password
- record.errors.add(attribute, :current_password_no_mathch)
+ record.errors.add(attribute, :current_password_no_match)
end
end
end
View
@@ -255,3 +255,4 @@ en:
no_allow_slash: "No allow slash"
messages:
tag_string: "Limit %{limit} tags"
+ current_password_no_match: 'Current password no match'
View
@@ -255,3 +255,4 @@ zh-CN:
no_allow_slash: "不能包含斜杠"
messages:
tag_string: "Tag 不能超过%{limit}个"
+ current_password_no_match: '当前密码不匹配'

0 comments on commit e2f8f11

Please sign in to comment.