Ukrainian pluralization bug

AI-generated summary

A discussion is ongoing about a potential Ukrainian pluralization bug in Discourse. neil has requested help with pluralization rules in Ukrainian and provided the current rules, which seem to be inconsistent with translations received from Transifex. gerhard pointed out that according to Unicode, the correct pluralization rules for Ukrainian should include “one”, “few”, “many”, and “other”, suggesting that the issue may be with Transifex switching “many” and “other”. neil confirmed that the pluralization rules used by Ruby and MessageFormat include “many” as an option, and further investigation revealed that Transifex does not provide “many” as an option for translators, indicating a likely Transifex bug.

If anyone can help me with pluralization rules in Ukrainian, that would be nice. :wink:

Currently, we have these rules:

I18n.pluralizationRules['uk'] = function (n) {
  if (n == 0) return ["zero", "none", "other"];
  if (n % 10 == 1 && n % 100 != 11) return "one";
  if (n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20)) return "few";
  return "many";
};

If n is 5, then it will default to many, but translations we get from Transifex never have many in them. e.g.,

    replies:
      one: "1 відповідь"
      few: "%{count} відповідей"
      other: "%{count} відповідей"

Should the rules be returning other instead of many? Or is there a problem with Transifex not returning the translations for many?

5 лайков

According to Unicode it should be one, few, many and other, where, if I read this correctly, other is only used for certain decimal numbers.

So, yeah, this could be a problem with Transifex where they switched many and other. But I don’t speak Ukrainian, so I may be mistaken.

BTW: Don’t forget the pluralization rules used by Ruby and MessageFormat.

4 лайка

Yeah they all include many as an option.

Transifex doesn’t have many as an option for translators. Looks like a Transifex bug.

3 лайка