Skip to content

Commit

Permalink
Add proper declination function for Russian locale
Browse files Browse the repository at this point in the history
  • Loading branch information
gmltA committed Nov 17, 2019
1 parent 22fabe4 commit ae89322
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion packages/material-ui/src/locale/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,18 @@ export const ruRU = {
nextIconButtonText: 'Следующая страница',
},
MuiRating: {
getLabelText: value => `${value} Звезд${value !== 1 ? 'ы' : 'а'}`,
getLabelText: value => {
let pluralForm = 'Звёзд';
const lastDigit = value % 10;

if (lastDigit > 1 && lastDigit < 5) {
pluralForm = 'Звезды';
} else if (lastDigit === 1) {
pluralForm = 'Звезда';
}

return `${value} ${pluralForm}`;
},
},
MuiAutocomplete: {
clearText: 'Очистить',
Expand Down

0 comments on commit ae89322

Please sign in to comment.