Skip to content

Instantly share code, notes, and snippets.

@akella
Created January 30, 2018 15:45
Show Gist options
  • Save akella/c8d0b0ce0dde1b9e5219f643467c28d1 to your computer and use it in GitHub Desktop.
Save akella/c8d0b0ce0dde1b9e5219f643467c28d1 to your computer and use it in GitHub Desktop.
Plural intl
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