rails/pluralization/hsb.rb in rails-i18n-7.0.6 vs rails/pluralization/hsb.rb in rails-i18n-7.0.7
- old
+ new
@@ -1,20 +1,18 @@
module RailsI18n
module Pluralization
module UpperSorbian
def self.rule
lambda do |n|
- n ||= 0
+ return :other unless n.is_a?(Numeric)
+
mod100 = n % 100
- if mod100 == 1
- :one
- elsif mod100 == 2
- :two
- elsif mod100 == 3 || mod100 == 4
- :few
- else
- :other
+ case mod100
+ when 1 then :one
+ when 2 then :two
+ when 3, 4 then :few
+ else :other
end
end
end
end
end