Skip to content

Commit

Permalink
fix: en cases
Browse files Browse the repository at this point in the history
  • Loading branch information
Valexr committed Apr 19, 2024
1 parent b96c2b9 commit f85f7f6
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ export function convert(en: keyof Trans, count = 0) {
hours: FIRSTABLE ? 'час' : SECONDABLE ? 'часа' : 'часов'
}

return RU ? trans[en] : count ? en.substring(0, en.length - 1) : en
// 1 - year/год | month/месяц | day/день | hour/час
// 2-4 - years/года | months/месяца | days/дня | hours/часа
// 0, 5-20 - years/лет | months/месяцев | days/дней | hours/часов
return RU ? trans[en] : count === 1 ? en.substring(0, en.length - 1) : en
}

0 comments on commit f85f7f6

Please sign in to comment.