Skip to content

Commit

Permalink
Add Korean to Internationalizable language list(on README)
Browse files Browse the repository at this point in the history
  • Loading branch information
clarke.lee committed Sep 10, 2018
1 parent f33c59f commit fc04152
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ validates_plausible_phone :phone_number, without: /\A\+\d+/
validates_plausible_phone :phone_number, presence: true, with: /\A\+\d+/
```

the i18n key is `:improbable_phone`. Languages supported by default: de, en, es, fr, it, ja, kh, nl, tr, ua and ru.
the i18n key is `:improbable_phone`. Languages supported by default: de, en, es, fr, it, ja, kh, ko, nl, tr, ua and ru.

You can also validate if a number has the correct country number:

Expand Down
12 changes: 6 additions & 6 deletions spec/lib/validators/phony_validator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -265,19 +265,19 @@ def email
end
end

it 'should translate the error message in Korean' do
I18n.with_locale(:ko) do
it 'should translate the error message in Khmer' do
I18n.with_locale(:km) do
@home.phone_number = INVALID_NUMBER
@home.valid?
expect(@home.errors.messages).to include(phone_number: ['는 올바른 전화번호가 아닙니다'])
expect(@home.errors.messages).to include(phone_number: ['គឺជាលេខមិនត្រឹមត្រូវ'])
end
end

it 'should translate the error message in Khmer' do
I18n.with_locale(:km) do
it 'should translate the error message in Korean' do
I18n.with_locale(:ko) do
@home.phone_number = INVALID_NUMBER
@home.valid?
expect(@home.errors.messages).to include(phone_number: ['គឺជាលេខមិនត្រឹមត្រូវ'])
expect(@home.errors.messages).to include(phone_number: ['는 올바른 전화번호가 아닙니다'])
end
end

Expand Down

0 comments on commit fc04152

Please sign in to comment.