Skip to content

Instantly share code, notes, and snippets.

@wegorich
Created August 24, 2013 10:33
Show Gist options
  • Save wegorich/6327356 to your computer and use it in GitHub Desktop.
Save wegorich/6327356 to your computer and use it in GitHub Desktop.
helpers._plural(n, ['элемент', 'элемента', 'элементов']) - склонения в русском языке
helpers._plural = (n, forms)->
forms[if n%10==1 && n%100!=11 then 0 else if n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) then 1 else 2]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment