Tangential: I love it when UIs say "1 object" and "2 objects". Shows attention to detail.
As opposed to "1 objects" or "1 object(s)". A UI filled with "(s)", ughh
As opposed to "1 objects" or "1 object(s)". A UI filled with "(s)", ughh
This is roughly the logic:
function strFromNumOfObjects(n) {
if (n === 1) {
return "obiekt";
}
let last_digit = (n%10);
let penultimate_digit = Math.trunc((n%100)/10);
if ((penultimate_digit == 0 || penultimate_digit >= 2) && last_digit > 1 && last_digit <= 4) {
return "obiekty";
}
return "obiektów";
}
Basically pluralizing words in Polish is a fizz-buzz problem :) In other Slavic languages it should be similar BTWhttps://devpal.co/icu-message-editor/?data=Zarezerwowa%C5%82...