It works, but incorrectly. Looks like only rule one and three are executed - i.e. I got "znak" for 1, and "znaków for 2 to infinity. While I should get "znak" for 1, "znaki" for 2-4 and "znaków" for 5-infinity.
The problem is, that I have no idea, what can be changed. I tested version with removed parenthesis and it also did not work as expected. This rule is very easy and, on the other hand, I don’t know CChoiceFormat much. I’m running out of ideas, why this is not working or what could be changed. That’s why I asked. :]
No, $max variable is 100% correct. Double checked it – not only, it comes from Yii/HTML (I’m using it to display information about max possible character per form field – i.e. $htmlOptions[‘maxlength’]), but I also print this value before CChoiceFormat result, so I have full control on it.
I agree that I’m using a rather old version of Yii in particular project, where I use CChoiceFormat. For the reasons, I don’t want to discuss here, I can’t update to the newer version (although I now that not updating is a bad idea). And I don’t have possibility to check it in another project running under newest Yii version.
So, to conclude, it is good to know, that it works like should in newest version. We could trace, when and how it was fixed, by analysing version changes and code commits, but I don’t see reason for doing so. Thanks and EoT.