Incorrect time delta on post (Ru interface only)

We’ve had problems like this reported over the years. I suspect it’s something wrong with this pluralization logic, but I would expect it to have been reported by now:

MessageFormat.locale.ru = function (n) {
  var r10 = n % 10, r100 = n % 100;

  if (r10 == 1 && r100 != 11)
    return 'one';

  if (r10 >= 2 && r10 <= 4 && (r100 < 12 || r100 > 14) && n == Math.floor(n))
    return 'few';

  return 'other';
};

That logic is very strange to us English-speakers… :wink:

4 Likes