svenfuchs
5/4/2009 - 8:02 AM

cldr pluralization rules

cldr pluralization rules

{
  :af  => { :_plural => lambda { |n| n == 1 ? :one : :other } },
  :am  => { :_plural => lambda { |n| (0..1).include?(n) ? :one : :other } },
  :ar  => { :_plural => lambda { |n| n == 0 ? :zero : n == 1 ? :one : n == 2 ? :two : (3..10).include?(n % 100) ? :few : (11..99).include?(n % 100) ? :many : :other } },
  :az  => { :_plural => lambda { |n| :other } },
  :be  => { :_plural => lambda { |n| n % 10 == 1 && n % 100 != 11 ? :one : (2..4).include?(n % 10) && !(12..14).include?(n % 100) ? :few : n % 10 == 0 || (5..9).include?(n % 10) || (11..14).include?(n % 100) ? :many : :other } },
  :bg  => { :_plural => lambda { |n| n == 1 ? :one : :other } },
  :bh  => { :_plural => lambda { |n| (0..1).include?(n) ? :one : :other } },
  :bn  => { :_plural => lambda { |n| n == 1 ? :one : :other } },
  :bo  => { :_plural => lambda { |n| :other } },
  :bs  => { :_plural => lambda { |n| n % 10 == 1 && n % 100 != 11 ? :one : (2..4).include?(n % 10) && !(12..14).include?(n % 100) ? :few : n % 10 == 0 || (5..9).include?(n % 10) || (11..14).include?(n % 100) ? :many : :other } },
  :ca  => { :_plural => lambda { |n| n == 1 ? :one : :other } },
  :cs  => { :_plural => lambda { |n| n == 1 ? :one : (2..4).include?(n) ? :few : :other } },
  :cy  => { :_plural => lambda { |n| n == 1 ? :one : n == 2 ? :two : n == 8 || n == 11 ? :many : :other } },
  :da  => { :_plural => lambda { |n| n == 1 ? :one : :other } },
  :de  => { :_plural => lambda { |n| n == 1 ? :one : :other } },
  :dz  => { :_plural => lambda { |n| :other } },
  :el  => { :_plural => lambda { |n| n == 1 ? :one : :other } },
  :en  => { :_plural => lambda { |n| n == 1 ? :one : :other } },
  :eo  => { :_plural => lambda { |n| n == 1 ? :one : :other } },
  :es  => { :_plural => lambda { |n| n == 1 ? :one : :other } },
  :et  => { :_plural => lambda { |n| n == 1 ? :one : :other } },
  :eu  => { :_plural => lambda { |n| n == 1 ? :one : :other } },
  :fa  => { :_plural => lambda { |n| :other } },
  :fi  => { :_plural => lambda { |n| n == 1 ? :one : :other } },
  :fil => { :_plural => lambda { |n| (0..1).include?(n) ? :one : :other } },
  :fo  => { :_plural => lambda { |n| n == 1 ? :one : :other } },
  :fr  => { :_plural => lambda { |n| n && n != 2 ? :one : :other } },
  :fur => { :_plural => lambda { |n| n == 1 ? :one : :other } },
  :fy  => { :_plural => lambda { |n| n == 1 ? :one : :other } },
  :ga  => { :_plural => lambda { |n| n == 1 ? :one : n == 2 ? :two : :other } },
  :gl  => { :_plural => lambda { |n| n == 1 ? :one : :other } },
  :gu  => { :_plural => lambda { |n| n == 1 ? :one : :other } },
  :guw => { :_plural => lambda { |n| (0..1).include?(n) ? :one : :other } },
  :ha  => { :_plural => lambda { |n| n == 1 ? :one : :other } },
  :he  => { :_plural => lambda { |n| n == 1 ? :one : :other } },
  :hi  => { :_plural => lambda { |n| (0..1).include?(n) ? :one : :other } },
  :hr  => { :_plural => lambda { |n| n % 10 == 1 && n % 100 != 11 ? :one : (2..4).include?(n % 10) && !(12..14).include?(n % 100) ? :few : n % 10 == 0 || (5..9).include?(n % 10) || (11..14).include?(n % 100) ? :many : :other } },
  :hu  => { :_plural => lambda { |n| :other } },
  :id  => { :_plural => lambda { |n| :other } },
  :is  => { :_plural => lambda { |n| n == 1 ? :one : :other } },
  :it  => { :_plural => lambda { |n| n == 1 ? :one : :other } },
  :iw  => { :_plural => lambda { |n| n == 1 ? :one : :other } },
  :ja  => { :_plural => lambda { |n| :other } },
  :jv  => { :_plural => lambda { |n| :other } },
  :ka  => { :_plural => lambda { |n| :other } },
  :km  => { :_plural => lambda { |n| :other } },
  :kn  => { :_plural => lambda { |n| :other } },
  :ko  => { :_plural => lambda { |n| :other } },
  :ku  => { :_plural => lambda { |n| n == 1 ? :one : :other } },
  :lb  => { :_plural => lambda { |n| n == 1 ? :one : :other } },
  :ln  => { :_plural => lambda { |n| (0..1).include?(n) ? :one : :other } },
  :lt  => { :_plural => lambda { |n| n % 10 == 1 && !(11..19).include?(n % 100) ? :one : (2..9).include?(n % 10) && !(11..19).include?(n % 100) ? :few : :other } },
  :lv  => { :_plural => lambda { |n| n == 0 ? :zero : n % 10 == 1 && n % 100 != 11 ? :one : :other } },
  :mg  => { :_plural => lambda { |n| (0..1).include?(n) ? :one : :other } },
  :mk  => { :_plural => lambda { |n| n % 10 == 1 ? :one : :other } },
  :ml  => { :_plural => lambda { |n| n == 1 ? :one : :other } },
  :mn  => { :_plural => lambda { |n| n == 1 ? :one : :other } },
  :mo  => { :_plural => lambda { |n| n == 1 ? :one : n == 0 ? :few : :other } },
  :mr  => { :_plural => lambda { |n| n == 1 ? :one : :other } },
  :ms  => { :_plural => lambda { |n| :other } },
  :mt  => { :_plural => lambda { |n| n == 1 ? :one : n == 0 || (2..10).include?(n % 100) ? :few : (11..19).include?(n % 100) ? :many : :other } },
  :my  => { :_plural => lambda { |n| :other } },
  :nah => { :_plural => lambda { |n| n == 1 ? :one : :other } },
  :nb  => { :_plural => lambda { |n| n == 1 ? :one : :other } },
  :ne  => { :_plural => lambda { |n| n == 1 ? :one : :other } },
  :nl  => { :_plural => lambda { |n| n == 1 ? :one : :other } },
  :nn  => { :_plural => lambda { |n| n == 1 ? :one : :other } },
  :no  => { :_plural => lambda { |n| n == 1 ? :one : :other } },
  :nso => { :_plural => lambda { |n| (0..1).include?(n) ? :one : :other } },
  :om  => { :_plural => lambda { |n| n == 1 ? :one : :other } },
  :or  => { :_plural => lambda { |n| n == 1 ? :one : :other } },
  :pa  => { :_plural => lambda { |n| n == 1 ? :one : :other } },
  :pap => { :_plural => lambda { |n| n == 1 ? :one : :other } },
  :pl  => { :_plural => lambda { |n| n == 1 ? :one : (2..4).include?(n % 10) && !(12..14).include?(n % 100) && !(22..24).include?(n % 100) ? :few : :other } },
  :ps  => { :_plural => lambda { |n| n == 1 ? :one : :other } },
  :pt  => { :_plural => lambda { |n| (0..1).include?(n) ? :one : :other } },
  :"pt-PT" => { :_plural => lambda { |n| n == 1 ? :one : :other } },
  :ro  => { :_plural => lambda { |n| n == 1 ? :one : n == 0 ? :few : :other } },
  :ru  => { :_plural => lambda { |n| n % 10 == 1 && n % 100 != 11 ? :one : (2..4).include?(n % 10) && !(12..14).include?(n % 100) ? :few : n % 10 == 0 || (5..9).include?(n % 10) || (11..14).include?(n % 100) ? :many : :other } },
  :se  => { :_plural => lambda { |n| n == 1 ? :one : n == 2 ? :two : :other } },
  :sh  => { :_plural => lambda { |n| n % 10 == 1 && n % 100 != 11 ? :one : (2..4).include?(n % 10) && !(12..14).include?(n % 100) ? :few : n % 10 == 0 || (5..9).include?(n % 10) || (11..14).include?(n % 100) ? :many : :other } },
  :sk  => { :_plural => lambda { |n| n == 1 ? :one : (2..4).include?(n) ? :few : :other } },
  :sl  => { :_plural => lambda { |n| n % 100 == 1 ? :one : n % 100 == 2 ? :two : (3..4).include?(n % 100) ? :few : :other } },
  :sma => { :_plural => lambda { |n| n == 1 ? :one : n == 2 ? :two : :other } },
  :smi => { :_plural => lambda { |n| n == 1 ? :one : n == 2 ? :two : :other } },
  :smj => { :_plural => lambda { |n| n == 1 ? :one : n == 2 ? :two : :other } },
  :smn => { :_plural => lambda { |n| n == 1 ? :one : n == 2 ? :two : :other } },
  :sms => { :_plural => lambda { |n| n == 1 ? :one : n == 2 ? :two : :other } },
  :so  => { :_plural => lambda { |n| n == 1 ? :one : :other } },
  :sq  => { :_plural => lambda { |n| n == 1 ? :one : :other } },
  :sr  => { :_plural => lambda { |n| n % 10 == 1 && n % 100 != 11 ? :one : (2..4).include?(n % 10) && !(12..14).include?(n % 100) ? :few : n % 10 == 0 || (5..9).include?(n % 10) || (11..14).include?(n % 100) ? :many : :other } },
  :sv  => { :_plural => lambda { |n| n == 1 ? :one : :other } },
  :sw  => { :_plural => lambda { |n| n == 1 ? :one : :other } },
  :ta  => { :_plural => lambda { |n| n == 1 ? :one : :other } },
  :te  => { :_plural => lambda { |n| n == 1 ? :one : :other } },
  :th  => { :_plural => lambda { |n| :other } },
  :ti  => { :_plural => lambda { |n| (0..1).include?(n) ? :one : :other } },
  :tk  => { :_plural => lambda { |n| n == 1 ? :one : :other } },
  :tl  => { :_plural => lambda { |n| (0..1).include?(n) ? :one : :other } },
  :to  => { :_plural => lambda { |n| :other } },
  :tr  => { :_plural => lambda { |n| :other } },
  :uk  => { :_plural => lambda { |n| n % 10 == 1 && n % 100 != 11 ? :one : (2..4).include?(n % 10) && !(12..14).include?(n % 100) ? :few : n % 10 == 0 || (5..9).include?(n % 10) || (11..14).include?(n % 100) ? :many : :other } },
  :ur  => { :_plural => lambda { |n| n == 1 ? :one : :other } },
  :vi  => { :_plural => lambda { |n| :other } },
  :wa  => { :_plural => lambda { |n| (0..1).include?(n) ? :one : :other } },
  :yo  => { :_plural => lambda { |n| :other } },
  :zh  => { :_plural => lambda { |n| :other } },
  :zu  => { :_plural => lambda { |n| n == 1 ? :one : :other } }
}