Skip to content

Instantly share code, notes, and snippets.

@grotezo
Created August 8, 2010 04:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grotezo/513585 to your computer and use it in GitHub Desktop.
Save grotezo/513585 to your computer and use it in GitHub Desktop.
I18n.backend.add_pluralizer(:ru,
lambda{ |c| \
c == 0 ? :none \
: (c % 10 == 1 && c % 100 != 11) ? :one \
: ((5..9).include?(c % 10) || (11..14).include?(c % 100) || c % 10 == 0) ? :many \
: (2..4).include?(c % 10) ? :few \
: :other })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment