Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #276 from s-andringa/issue-275

Adhere to CLDR standard for Hungarian pluralization [#275].
  • Loading branch information...
commit 4eb7418af933646488c0fec02d47051f25bece0e 2 parents 408b9c3 + 647cb0e
@kfl62 kfl62 authored
View
18 lib/rails_i18n/common_pluralizations/only_one.rb
@@ -1,18 +0,0 @@
-# Used in Hungarian
-module RailsI18n
- module Pluralization
- module OnlyOne
- def self.rule
- Proc.new { :one }
- end
-
- def self.with_locale(locale)
- { locale => {
- :'i18n' => {
- :plural => {
- :keys => [:one],
- :rule => rule }}}}
- end
- end
- end
-end
View
4 rails/pluralization/hu.rb
@@ -1,3 +1,3 @@
-require 'rails_i18n/common_pluralizations/only_one'
+require 'rails_i18n/common_pluralizations/other'
-::RailsI18n::Pluralization::OnlyOne.with_locale(:hu)
+::RailsI18n::Pluralization::Other.with_locale(:hu)
View
11 spec/unit/pluralization/one.rb
@@ -1,11 +0,0 @@
-shared_examples 'one form language' do
- it 'has "other" plural keys' do
- plural_keys.should == [:one]
- end
-
- [0, 1, 1.2, 2, 5, 11, 21, 22, 27, 99, 1000].each do |count|
- it "detects that #{count} in category 'one'" do
- rule.call(count).should == :one
- end
- end
-end
View
3  spec/unit/pluralization_spec.rb
@@ -8,7 +8,6 @@
require 'support/pluralization_file'
require 'unit/pluralization/ordinary'
-require 'unit/pluralization/one'
require 'unit/pluralization/other'
require 'unit/pluralization/one_with_zero_other'
require 'unit/pluralization/one_upto_two_other'
@@ -283,7 +282,7 @@
describe 'Hungarian', :locale => :hu do
it_behaves_like 'an ordinary pluralization rule'
- it_behaves_like 'one form language'
+ it_behaves_like 'other form language'
end
describe 'Igbo', :locale => :ig do
Please sign in to comment.
Something went wrong with that request. Please try again.