Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Choice pattern in properties file

I have a properties file with messages and I want to handle some special cases of plural. Now I use:

xxx.yyy.plural=test{0,choice,2#y}

but it formats 12 as 'testy' also. How can I specify 2 as exact match?

like image 259
DominikM Avatar asked Aug 27 '12 08:08

DominikM


1 Answers

I found an answer. It seems that choice statement in properties file works properly only if more than one choice is specified. So you have to specify at least one "else branch" If i rewrite my example:

xxx.yyy.plural={0,choice,2#testy|2<test}
like image 180
DominikM Avatar answered Sep 18 '22 13:09

DominikM