Created
January 30, 2018 15:45
-
-
Save akella/c8d0b0ce0dde1b9e5219f643467c28d1 to your computer and use it in GitHub Desktop.
Plural intl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let items = new Intl.PluralRules('ru-RU'); | |
let result,word; | |
for(var i = 0;i<25;i++){ | |
if(items.select(i)=='one'){ | |
word = 'шаурма'; | |
} | |
if(items.select(i)=='few'){ | |
word = 'шаурмы'; | |
} | |
if(items.select(i)=='many'){ | |
word = 'порций шаурмы'; | |
} | |
result = i + ' ' + word; | |
console.log(result) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment